Have you tried using the pre-made XSLT file for navigation, which can be selected in the dropdown when you create a new XSLT file in Umbraco? Maybe this can help you out too.
The reason why you don't get any pages in your output is probably that there are no nodes under the $currentPage node.
I really should have caught this issue when reading your post the first time. But if I understand correctly you have three pages directly under "content", which are at the same level, right?
So your current content structure looks something like this
Content - node - node - node
But for this navigation macro to work you need to have a structure like this
Content - Root node - Subnode - Subnode - Subnode
Then the three subnodes will occur in the navigation.
That's allright - you have to start off from somewhere and that's why we are here to help each other out :-)
Well I'm asuming you have made at least one document type under the "settings" section. On the document type there is a "structure" tab, where you can choose, which document types are allowed to create under the current one. So if you want to be able to make a structure like the one I have proposed to you then make sure it's allowed to create the document type under itself.
Then you can create at node you call "Home" and under that one you can create your subpages etc.
I hope it all makes sense.
Since you are new to Umbraco I can also recommend that you have a look at the Creative Website Starter package, created by Warren Buckley. It installs a complete site in your Umbraco solution where you can get a lot of inspiration on how to do things in Umbraco.
A simpler package that can also be great for learning Umbraco is the "Runway package".
Both packages can be installed from the "developer" section where you can find the "CWS" package in the package repository under "starter kits". Runway can be installed by choosing "install runway".
Yes, I have the CWS package installed at work but not at home. I'm trying to simply learn the templating side at the moment from the ground up as most of what I do is front-end development :)
XLST Basic Navigation
Hi,
New to Umbraco and having a lot of fun getting to grips with it - so far it looks like a great system!
I'm having some difficulty getting a basic navigation to display though. I followed the video here;
http://umbraco.tv/documentation/videos/for-site-builders/foundation/creating-your-first-xslt-macro
however when I insert the Macro into my template, save, the source code just displays </ul> - and doesn't output the list items.
I've got just three pages in the site tree.
I'm running Umbraco v4 locally using Cassini web server.
Sorry for being a bit vague - let me know if any other information is required!
thanks
Ewan
Hi Ewan, can you post the contents of your XSLT? Also, are your nodes directly under the 'Content' (aka root) node?
Thanks,
Nik
Hi Nik,
I'll post the contents this evening (I'm at work and am working on it at home)
Yes, the nodes are directly under Content.
thanks
Ewan
Hi Ewan
Have you tried using the pre-made XSLT file for navigation, which can be selected in the dropdown when you create a new XSLT file in Umbraco? Maybe this can help you out too.
/Jan
Hi Jan,
yep, I'm pretty sure I did that. I think that's what the video instructed.
I'll set up Umbraco here in the office on my lunch break today and go through the process again.
thanks
Ewan
Hi Guys,
here is the contents of my xlst file;
thanks
Ewan
Hi Ewan
The reason why you don't get any pages in your output is probably that there are no nodes under the $currentPage node.
I really should have caught this issue when reading your post the first time. But if I understand correctly you have three pages directly under "content", which are at the same level, right?
So your current content structure looks something like this
Content
- node
- node
- node
But for this navigation macro to work you need to have a structure like this
Content
- Root node
- Subnode
- Subnode
- Subnode
Then the three subnodes will occur in the navigation.
I hope this helps
/Jan
HI Jan, thanks very much for your help. I should have probably noted in my original post that it was likely something to do with my setup.
Excuse the newbie question, but how do I now create the Root node and move all my created nodes under this one?
thanks
Ewan
Hi Ewan
That's allright - you have to start off from somewhere and that's why we are here to help each other out :-)
Well I'm asuming you have made at least one document type under the "settings" section. On the document type there is a "structure" tab, where you can choose, which document types are allowed to create under the current one. So if you want to be able to make a structure like the one I have proposed to you then make sure it's allowed to create the document type under itself.
Then you can create at node you call "Home" and under that one you can create your subpages etc.
I hope it all makes sense.
Since you are new to Umbraco I can also recommend that you have a look at the Creative Website Starter package, created by Warren Buckley. It installs a complete site in your Umbraco solution where you can get a lot of inspiration on how to do things in Umbraco.
A simpler package that can also be great for learning Umbraco is the "Runway package".
Both packages can be installed from the "developer" section where you can find the "CWS" package in the package repository under "starter kits". Runway can be installed by choosing "install runway".
Have fun!
/Jan
Hi Jan
that seems to have done it. Many thanks again.
Yes, I have the CWS package installed at work but not at home. I'm trying to simply learn the templating side at the moment from the ground up as most of what I do is front-end development :)
cheers
Ewan
Glad it helped! :-)
Well, the CWS is a great package to learn the frontend-stuff from. There are many usefull XSLT snippets in there.
is working on a reply...