How about putting something like this in your layout:

<?php
if (!isset($description))
{
        $description = preg_replace ("@</?[^>]*>*@", "", $content_for_layout);
        $description = preg_replace('/\s\s+/', ' ', $description);
        $description = substr($description, 0, 400);
}
?>
<meta name="description" content = "<?php echo $description ?>" />

Therefore if the varaible $description isn't set, just use the first x
characters of your page content.

HTH,

AD7six


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to