Search

Hi,

after I got this thing working, I like it! But what I'm still missing is a possibility to make submenu points. Did I missed something or is it not possible yet? Is there an extension for it?

Thanks leerraum

What kind of "submenu points" are you thinking of?

in the standard installation there are * Archive * About * Drafts * Admin * Debug

what do I have to do, to get something like this:

* Archive
* About
   * my wife
   * my house
   * my boat
* Drafts
* Admin
* Debug

@leerraum, this doesn't happen out of the box afaik.

these were the steps i did to create the sub nav the way you want it:

  1. any sub nav items were grouped under a common Parent Page in the Page > Configure > URL Settings
  2. the outputted data source used has the default <navigation> node with this navigation.xsl template applied to it.
  3. i called this template from the main template like so

seems like there's an issue with markdown and using code blocks after a list

<xsl:apply-templates select="data/navigation">  
  <xsl:with-param name="area" select="'main'" />  
</xsl:apply-templates>

the reason why I have the area param is b/c i applied this same template to my main menu at the top of the page and then my footer at the bottom. I only wanted my sub nav to be produced on my main menu. so by specifiying the area param, i was able to achieve this result.

towards the bottom of the navigation.xsl file, you'll see this recursive call:

<xsl:if test="page and $area = 'main'">

this asks if there are anymore children of the current node with the name page and if the $area is the main (menu) area. if both of these parameters are met, then reapply the page template (<xsl:template match="page">) with the next two parameters: area (same as above) and parent. this is merely to build out the correct url string.

i didn't test this out for multiple levels, only on the first sub nav level. But the logic seems like it should work as long as the children nodes are named page.

note - line 27, if you want the admin menu to show up, replace THE_USER_NAME with the appropriate user name.

hope this helps.

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