Search

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 the handle 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 of titulo node.

How I can pass this string to my master.xsl and have good SEO title?

Or have other way?

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details