Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
MeekelTM Posted October 24, 2015 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.
Ibragim Pupkevich Posted October 24, 2015 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.)?
MeekelTM Posted October 24, 2015 Author 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.
tenaki Posted October 24, 2015 Posted October 24, 2015 I use twitter cards on another site, I will have a look at how it is set up
MeekelTM Posted October 24, 2015 Author 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}}
CheersnGears Posted January 10, 2016 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']}" />
Recommended Posts
Archived
This topic is now archived and is closed to further replies.