Search

I have created a page which only contains child-pages via parameters:

/page/child

As it's a toplevel page it's part of the main navigation. I would like now to make the page directly link to it's first "real" page.

Right now the menu goes to:

/page

which is merely a blank page. Can I do something (incl. editing the PHP) that will tell the <navigation> datasource the correct address?

Okay, I could quickly help myself by overriding the template for the handle in question in the navigation template:

<xsl:template match="page[@handle='page']">
    <li>

I don't really think that this info belongs into the XSL but for the moment it works.

Other ideas still welcome, I'm new so don't know what's commonly done in such situations.

I don't really think that this info belongs into the XSL but for the moment it works.

XSLT is exactly where the logic belongs. XSLT drives Symphony CMS' templating on the front end and your approach is one of many different ones you could take.

Yes, but what I dislike is that I hardencode the magic string "page" inside the template itself. This introduces a "datasource" on it's own that is disconnected to the sites' datasources.

So no problems to have display logic here, but to introduce duplicated data.

Yes, but what I dislike is that I hardencode the magic string "page" inside the template itself.

I see. Check out axes. Try something like:

<xsl:template match="page[following-sibling::*]">
    ...
</xsl:template>

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