[opencms-dev] SEO description/keywords in meta-tags in detailpage

Sandrine Prousteau s.prousteau at eurelis.com
Tue May 14 11:10:30 CEST 2013


Hi
We have resolved this problem with a custom tag, inspired by the OpenCms tag "cms:info", and working with the properties Description and Keywords. It requires to create a custom CmsJspTagInfo, based on the OpenCms one, and complete it with the needed options.
Sandrine


-----Message d'origine-----
De : opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] De la part de Andreas Gily
Envoyé : vendredi 10 mai 2013 17:14
À : opencms-dev at opencms.org
Objet : [opencms-dev] SEO description/keywords in meta-tags in detailpage

Hi list members,

My content is mostly made of "v8news"-like items in various .content folders.

I have to use SEO with meta-keywords and meta-description support. 
In the XSD definition I've mapped title, description and keywords with their properties. 

When I access my news-item via detail-page, it works like a charm with the "Title" property. 
Unfortunately the news-item properties for description and keywords are not shown, because there is no special <cms:info ... /> tag and <cms:property... /> only uses the properties from the enclosing structured content detail page...

<title><cms:info property="opencms.title" /></title> <meta name="description" content="<cms:property name="description" file="search" />"> <meta name="keywords" content="<cms:property name="keywords" file="search" />">


I've been searching all day long, but I did not find any solution yet...

If there is no easy tag for this: is there a way to find out (with scriptlet code?), which news-item is currently displayed in a detail-page? 
I thought about extracting the vfs url somehow and getting the property via: <cms:property name="Description" file="..." />

I've also thought about extracting the info inside the detail page formatter, but using jquery to modify the meta-tags after the page has loaded may not be the right solution, because crawlers may not use javascript...



Thanx in advance for some tips about this issue!


cheers,

Andreas





More information about the opencms-dev mailing list