Twitter Cards

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Oct 14, 2015 9:25 pm
Reply with quote
Report this post
Hello, I am trying to set up twitter cards an I have a problem, when I try to validate it I recieve a "WARN: Not whitelisted" and I don't know what I am doing wrong.

I guess the article template default is /templates/gk_news2/html/com_content/article/default.php
So I introduce my code
Code: Select all
// Variable para meta descripcion
$document = JFactory::getDocument();
$document->addCustomTag($headtag);
$metaDesc = $document->getMetaData('description'); //Obtiene la meta descripción ingresada en el articulo

// Variable para twittercard
$twittercard .= '<meta name="twitter:card" content="summary_large_image">' ."\n";
$twittercard .= '<meta name="twitter:site" content="@twitterEmprsa">' ."\n";
$twittercard .= '<meta name="twitter:creator" content="@twitterAutor">' ."\n";
$twittercard .= '<meta name="twitter:title" content="'.$this->item->title.'"/>' ."\n";
$twittercard .= '<meta name="twitter:description" content="'.$metaDesc.'"/>' ."\n";
$twittercard .= '<meta name="twitter:image:src" content="'."https://www.territoriosnow.com/".$images->image_fulltext.'"/>' ."\n";


I think this is a correct code because if I create a new default.php but with joomla template (/territoriosnow/components/com_content/views/article/tmpl/default.php) it works fine and twitter validates my card.

Any idea what is wrong??

Thanks
User avatar
Senior Boarder

teitbite
Mon Oct 19, 2015 9:53 am
Reply with quote
Report this post
Hi

Do You mean it works when You use /components/com_content/views/article/tmpl/default.php and no /templates/gk_news2/html/com_content/article/default.php ?? This may only means that a default joomla article layout file is being used instead of the override. Try maybe take the file from template and replace the componnent one for some tests. Are there any error messages if You will use it like that ?
User avatar
Moderator

GK User
Sun Nov 01, 2015 3:42 am
Reply with quote
Report this post
Sorry for the delay.
So, if I create a new alternative layout copying default.php from /components/com_content/views/article/tmpl/default.php and I add twitter cards meta.. It works.
But if I create the alternative layout form the template, it doesn't work.

I don't understand the test you propose to me.. (I don't speak a realy good englush, sorry).
User avatar
Senior Boarder

teitbite
Wed Nov 04, 2015 11:53 am
Reply with quote
Report this post
Hi

I will need an access to FTP to check that. Please leave the layout You have created for tests. I'll use it in template override somehow.
User avatar
Moderator

GK User
Mon Nov 09, 2015 4:56 am
Reply with quote
Report this post
I have sent it by private message
User avatar
Senior Boarder

teitbite
Wed Nov 11, 2015 2:00 pm
Reply with quote
Report this post
Hi

I've added Your code to /html/com_contact/article/default.php and looks like it's working just fine. With the issue from AddThis unfortunately, but this is something which is added by plugin or directly in code. There is nothing I can do about that other than advice to move it to the bottom or to replace with a solution which doesn't modify article content.
User avatar
Moderator

GK User
Wed Nov 11, 2015 6:33 pm
Reply with quote
Report this post
Thanks teibite, it works fine now. I've been cheking and the issue is due to the addthis plugin
I'll write them again.
User avatar
Senior Boarder

teitbite
Fri Nov 13, 2015 3:47 pm
Reply with quote
Report this post
Hi

Ok. Can You please write that they would say? I'm curious how this could be solved. Thank You.
User avatar
Moderator


cron