Question

How to fill properly a specific tag attribute taking the content from the original page by using Diazo in the following case?

A skeleton for new site has several meta tags like this:

<meta name="Author" content="author" />

XPATH for the author in Plone default welcome page:

//span[@class='documentAuthor']/a

XPATH for the Author meta tag in the new theme skeleton:

/html/head/meta[@name='Author']

So I would like to fill the content="author" to be like content="Admin" from the original page.

Was it helpful?

Solution 2

The best solution I have found so far is:

<replace theme="/html/head/meta[@name='Author']">
 <xsl:variable name="auth" select="//span[@class='documentAuthor']/a" />
 <meta name="Author" content="{$auth}" />
</replace>

OTHER TIPS

You should not try to make this work.

This is about business things and theme should never try to do this kind of things. This depends on the page. You will have many exceptions * search page * collection * login page * sitemap

On all theses pages it doesn't make sens to have an author meta.

So you should achieve your goal by creating an addon and developing 'viewlets'.

More on viewlet: http://developer.plone.org/views/viewlets.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top