5 users online. Create an account or sign in to join them.Users
another nav question :)
This is an open discussion with 9 replies, filed under General.
Search
You’d have to add another field to your Nav section I think.
- You could use the Pages field. That’d be one way.
- Another way is you could add a ‘link’ or ‘path’ field, in case the nav doesn’t have a one-to-one relationship with your Pages
thanks czheng….I will try tonight.
if your pages have the same name as your urls you could create a link tag like this
assuming xml is:
data/nav/entry/item
for each entry in nav
<a href="{$root}/{item/@handle}"><value-of select="item" /></a>
end for each
use the handle to get rid of capitals and spaces
ummm wow..ok hehe.
some explanation here the value of select item will be created as the xml loops and adds in entries (ie nav one/nav 2 nav three etc?)
$root is a variable that references ex “www.mysite.com/” and if so where is this variable set? is this part of installation?
also is {item/@handle} a parameter? or is it using the item (entry) and passing it as a parameter?
Thanks Jeff!
$root is part of the param pool (you can see them all using the debug extension).
I’m not totally clear on your question about {item/@handle}. In XSLT when you want to drop something from your source XML into an attribute in your output (in this case href) you can use these curly braces, called ‘attribute value templates’. You can put some Xpath (though not all xpath I think) into the braces and it acts like a ‘value-of’.
Jeff is assuming the context node has <item>s available for his example.
I just was not sure what {item/@handle} is
here is an example
<item handle="contact">Contact</item>
The handle is the text value of the item but with no capitals and spaces replaced with a -
linking to the @handle makes your urls looks cleaner. just make sure your page url matches the handle(like a contact us page should have a url of contact-us)
We really need a Symphony XSLT guide. Who’s in charge of the documentation around here?
sweet. makes sensei.
lol, man I symphony xslt guide would be fantastic. I can’t wait to use it on my site, but not confident yet on it. really looking forward to it.
Create an account or sign in to comment.
1) Created a section call Nav that has a text input option 2) Created a data source that pulls from Nav 3) Created Page that uses a for each to loop through and output a li element for each item in the for nav entry.
works great, stupid question of the day… how do I actually make an “entry” a link to a page within the cms.
I have seen the extension that creates a multilevel nav and I will work my way up, but am trying to start really basic.
I am no clear on the step I am missing.
Thanks for taking time.