MeekelTM Posted October 24, 2015 Share Posted October 24, 2015 Does anyone have any experience to adding meta tags for Twitter Cards when it comes to the Pages application? I was looking at the includeMeta template within core->global->global to potential add some form of if statement that if on the pages application, grab the author and various other data that is tied to the current page (ie an article). Any help would be appreciate as I couldn't find much when searching. Link to comment Share on other sites More sharing options...
Ibragim Pupkevich Posted October 24, 2015 Share Posted October 24, 2015 You mean to make your board bages displyaed properly in Twitter when shared by someone? https://dev.twitter.com/cards/overview Or you mean embedding tweets in your board content items (posts, comments etc.)? Link to comment Share on other sites More sharing options...
MeekelTM Posted October 24, 2015 Author Share Posted October 24, 2015 Just now, Ibragim Pupkevich said: You mean to make your board bages displyaed properly in Twitter when shared by someone? https://dev.twitter.com/cards/overview Or you mean embedding tweets in your board content items (posts, comments etc.)? In regards to board pages being displayed in Twitter when shared. More specifically I'm looking at it in regards to articles on my site, but other pages are applicable I guess. Link to comment Share on other sites More sharing options...
tenaki Posted October 24, 2015 Share Posted October 24, 2015 I use twitter cards on another site, I will have a look at how it is set up Link to comment Share on other sites More sharing options...
MeekelTM Posted October 24, 2015 Author Share Posted October 24, 2015 For the time being I've hacked together this in the includeMeta template which at least gives me the title and description but obviously I could do with it being a little cleaner and include author data and possibly image. <meta name="twitter:card" content="summary" /> <meta name="twitter:site" content="@RespawnGG" /> {{foreach \IPS\Output::i()->metaTags as $name => $content}} {{if $name != 'title'}} {{if is_array( $content ) }} {{foreach $content as $_value }} {{if $name === 'og:title'}} <meta name="twitter:title" content="{$_value}"> {{endif}} {{if $name === 'og:description'}} <meta name="twitter:description" content="{$_value}"> {{endif}} {{endforeach}} {{else}} {{if $name === 'og:title'}} <meta name="twitter:title" content="{$content}"> {{endif}} {{if $name === 'og:description'}} <meta name="twitter:description" content="{$content}"> {{endif}} {{endif}} {{endif}} {{endforeach}} Link to comment Share on other sites More sharing options...
CheersnGears Posted January 10, 2016 Share Posted January 10, 2016 <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="@cheersngears"> <meta name="twitter:image" content="{$this->settings['meta_imagesrc']}" /> <if test="metatags:|:is_array( $metaTags ) AND count( $metaTags )"> <foreach loop="metaTags:$metaTags as $tag => $id"> <foreach loop="metaTagsInner:$metaTags[ $tag ] as $content"> <if test="ogCaveman:|:stristr( $tag, 'og:' )"> <meta property="{$tag}" content="{$content}" /> <else /> <meta name="{$tag}" content="{$content}" /> </if> <if test="hasIdentifier:|:$tag == 'identifier-url'"> <meta property="og:url" content="{$content}" /> </if> <if test="hasDescription:|:$tag == 'description'"> <meta property="og:description" content="{$content}" > <meta name="twitter:description" content="{$content}" /> </if> <if test="hasDescription:|:$tag == 'title'"> <meta property="og:title" content="{$content}" > <meta name="twitter:title" content="{$content}" /> </if> </foreach> </foreach> </if> <meta property="og:image" content="{$this->settings['meta_imagesrc']}" /> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.