Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hello,

I wanted to know how could I add the meta description automatically from the blog content, I have tried something like :

<meta name="description" content="<cms:show blog_content />" />

...but this doesn't work...it only places the text above my website...I need this to display description from each blog post when sharing on social networks...
Hello Alin,

The editable region ('blog_content') you are using to populate the meta- I think, since it is primarily intended to hold blog contents, is likely to have HTML tags within it.

The HTML tags within meta probably are breaking the code.

Try using the following instead -
Code: Select all
<meta name="description" content="<cms:excerpt count='255'><cms:show blog_content /></cms:excerpt>" />

Or better still, use a standalone region of either type 'text' or 'textarea' and put in the meta content manually.

Hope this helps.
2 posts Page 1 of 1
cron