Optimizing Concrete5 for Search Engines ?
Permalink
Hi,
I'm trying to play around with meta description. So that users do not have to write their own description, but letting Concrete5 use the text from the "Content" blog. So that non tech savvy people don't have to add the pageDescription themselves.
I got the pageDescription stripped and what not, but I still don't know, how I can tell it to use the content that is inside the "Content" area ?
I'm trying to play around with meta description. So that users do not have to write their own description, but letting Concrete5 use the text from the "Content" blog. So that non tech savvy people don't have to add the pageDescription themselves.
I got the pageDescription stripped and what not, but I still don't know, how I can tell it to use the content that is inside the "Content" area ?
<meta name="description" content="<?php $limit=255; // Define how many character you want to display. $metaDescription = htmlspecialchars ($pageDescription, ENT_COMPAT, APP_CHARSET); $metaDescription = trim( preg_replace( '/\s+/', ' ', $metaDescription ) ); $showMetaDescription = substr($metaDescription, 0, $limit); echo $showMetaDescription ?>" />
I don't know if this will work? but in theory
The idea being to grab the blocks within main grab the content block(the code will use the last instance it finds) then grab the content from that block reduce it to 200 chars and add it to the meta description.
I only have one content block in my main(and I use the $_POST value as I am dealing with an entry from the dasboard)
I only have one content block in my main(and I use the $_POST value as I am dealing with an entry from the dasboard)