3 users online. Create an account or sign in to join them.Users
This is an open discussion with 7 replies, filed under General.
I apologize in advance if a question like this has already been asked; I wasn’t able to find it in the documentation or on the forum.
Basically, I’m creating a website for a client that needs to have dynamic navigation. The navigation data source works perfectly when each link in the navigation bar is directly linked to a Symphony page. However, certain pages (about, contact, etc) are part of a section, and not independent pages.
Is there a simple way to combine pages and items from one section into a single data source? I’d prefer not to statically code the menu or create an extension.
You can’t merge different datasources into datasource.
But you can combine the output of your navigation datasources with a “static page section navigation” datasource in your XSLT.
To have more control over the order you could create a separate menu section with a title field, a selectbox link field, a pages field and an order entries field. It’s semi dynamic and requires an extra step in your workflow.
Actually, a separate menu section might even work better. Thanks for the suggestion—I never would have found those extensions otherwise.
You could also create special templates for each page that needs a submenu. In this template you’ll simply apply another template on those entries fron the other DS.
I can write you some XSLT if you show me the XML of your navigation and the one from the section in question.
hello. This is kinda what i am looking for. I have a contact link in the navigation that i want to go to the footer. But i dont know how to write the xslt to do that. Any ideas?
@dignmg You could either set the type of your page to something like footer and either create a separate navigation datasource that filters pages by this type or you could call your navigation template with a modeparameter and do the filtering in the XSL, provided that you have such a template. Something like
<xsl:template match="navigation" mode="footer">
<xsl:apply-templates select="page[types/type = 'footer']"/>
as a starting point.
alright. But how would this play into the normal nav datasource that comes with symphony? Would i have to make another data source for every other link but the footer?
The navigation datasource that comes with the default workspace is AFAIK not filtered, so it’s a nested set of all pages. So there is no need to create new datasources when you are able to filter the pages in your XSLT.
I usually have a main navigation and some separate meta navigation. So I tag my pages using the type field and crate a separate XSL template as shown above.
Create an account or sign in to comment.
Contact the team
Symphony • Open Source XSLT CMS