Gnuru Posted April 6, 2015 Share Posted April 6, 2015 when using pages and adding some articles, the og:description holds the whole article and bloats the html page.I would suggest to use only max 200 characters for the description.E.g. in the includeMeta Template I use this code:{{foreach \IPS\Output::i()->metaTags as $name => $content}} {{if $name != 'title'}} {{if is_array( $content ) }} {{foreach $content as $_value }} <meta {{if mb_substr( $name, 0, 3 ) === 'og:'}}property{{else}}name{{endif}}="{$name}" content="{{substr($_value,0,strpos($_value, ' ', 200));}}"> {{endforeach}} {{else}} <meta {{if mb_substr( $name, 0, 3 ) === 'og:'}}property{{else}}name{{endif}}="{$name}" content="{{$trc=substr($content,0,200);}}$trc"> {{endif}} {{endif}} {{endforeach}}But I'm not really firm with coding.... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.