I need insert keywords into the meta keywords part of a web page, dynamically, using page templates. The list of keywords is pulled from a list of subjects like this: ('foo','bar','foobar') The list is actually the subject element from the Dublin Core metadata in CMF content. The code I am using currently is: <meta name="keywords" content="Keywords, will, appear, here" tal:repeat="item here/subject" tal:attributes="content repeat/item"> That code results in (from a list of 5 subjects): <meta name="keywords" content="<Products.PageTemplates.TALES.Iterator instance at 023755CC>"> <meta name="keywords" content="<Products.PageTemplates.TALES.Iterator instance at 023755CC>"> <meta name="keywords" content="<Products.PageTemplates.TALES.Iterator instance at 023755CC>"> <meta name="keywords" content="<Products.PageTemplates.TALES.Iterator instance at 023755CC>"> <meta name="keywords" content="<Products.PageTemplates.TALES.Iterator instance at 023755CC>"> How do I get TAL to list one keyword after another in the quotes rather than creating a new tag on each iteration? Also, how do I convert them to strings, rather than the object instances they are now? Thanks
On Thu, 21 Feb 2002, Chad Nantais wrote: <meta name="keywords" contents="will, appear, here" tal:attributes="content python:string.join(a,',')"> (might need to help TAL find the string module; I don't remember.)
I need insert keywords into the meta keywords part of a web page, dynamically, using page templates. The list of keywords is pulled from a list of subjects like this: ('foo','bar','foobar') The list is actually the subject element from the Dublin Core metadata in CMF content.
The code I am using currently is:
<meta name="keywords" content="Keywords, will, appear, here" tal:repeat="item here/subject" tal:attributes="content repeat/item">
That code results in (from a list of 5 subjects):
<meta name="keywords" content="<Products.PageTemplates.TALES.Iterator instance at 023755CC>">
...
How do I get TAL to list one keyword after another in the quotes rather than creating a new tag on each iteration? Also, how do I convert them to strings, rather than the object instances they are now?
-- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant
"Chad Nantais" <cnantais@rednaxel.com> writes:
<meta name="keywords" content="Keywords, will, appear, here" tal:repeat="item here/subject" tal:attributes="content repeat/item"> ^^^^^^ Why are you referencing repeat?
Just tal:attributes="content item" should work.
participants (3)
-
Chad Nantais -
Jens Quade -
Joel Burton