Update page title for SEO
This is an open discussion with 2 replies, filed under XSLT.
Search
The first step would be to take your title out into a separate template
then ovverride this template from each of your pages so that you provide the right handles.
I have a full article of my prefered way to do Titles & Metas with Symphony here a bit lazy to copy all of it.
Essentially the trick is to split each one separately. Keep in mind that when you want to to put the title, I would not use the handle but rather find the data-node in the XSL with the proper title. So I'd use
<xsl:value-of select='/data/mysection/entry/titulo'/>
Note I match from /data
because in this node most likely you are still in root and not on the current page so the complete xpath would be required. If you still find problems feel free to ask
If you know that you have a Data Source that contains the title you are seeking for, you could just use your URL parameter like so:
<xsl:value-of select="//entry/titulo[@handle = $titulo]" />
(I expect your URL parameter to be named $titulo
here – could be anything else you have of course.)
Create an account or sign in to comment.
I have this page title behavior on
master.xsl
utility.<title><xsl:value-of select="concat($page-title, ' - ', $website-name)"/></title>
But I would like update
$page-title
parameter with thehandle
of current "post" or "news" like:http://interface:8888/noticias/a-responsabilidade-do-despachante-aduaneiro/
So part of title of news is:A RESPONSABILIDADE DO DESPACHANTE ADUANEIRO
.or
servicos/laboratorio-textil/
So part of title will be:
Laboratório Têxtil
because this is value oftitulo
node.How I can pass this string to my
master.xsl
and have good SEO title?Or have other way?