Howdy,
I’m using the Professional Template set, and I’ve managed to convert it over to my own look/feel. I even have figured out the top navigation bar using the PageListing widget to create the drop-down navigation.
Now.. I need to create the left-navigation. Using the PageListing widget, I can create it, BUT, I cannot see a way to get the left navigation to build based off what the current folder is.
What I get now is:
Section A page 1 page 2 page 3 Section B page 1 page 2 page 3 Section C page 1 page 2 page 3
What I want is:
Section A Section B page 1 page 2 page 3 Section C
Where the current page could be bolded, and only the sub-pages in the current folder would be listed.
I could also live with:
Section B page 1 page 2 page 3
Where only the current folder is listed.
There appears to be a Template Tag for “CurrentPage” but it appears to have limited use, and there isn’t one I see for the current folder.
Any ideas?
Reported on Movable Type 4.2
I had something similar on my site, but decided I didn't have enough content to hide all but the pages in context!
Here's how i did it:
That's the second level navigation widget, then you just need to add some variables to your page template:
These are there to stop it from trying to do this on other pages or pages outside of a page context. The page ID 177 in mine is the home page, so that just stops it attempting to create the folder list for a page that doesn't have a folder.
Thanks!
That seems to be doing the first part.. now some more questions:
1) How do I get the "parent" folder to list? (and ideally the Aunt/Uncle folders to list?)
2) How do I hide the "child" pages unless the page is current one? (Perhaps I need to change my thinking about the way pages would appear, since it seems that MT isn't going to give me the exact same structure I would get doing this in pure html, and I'm guessing that you can't have child pages of a page, can you?.. How do you tie a folder to a page that isn't in the folder?)
(I'm not using the variables atm, rather using the ArchiveType to decide if it generates the nav or not)
(I was trying to paste in my code to show what I was doing, but I guess I'm unaware of the right tag to use to display code here... :-P
RE pasting code: copy into a good text editor then indent by one tab then paste back in here, markdown should take care of the rest.
http://www.movabletype.org/documentation/appendices/tags/
There's a few tags in there that should be of use, i *think* you want the following tags:
TopLevelFolder (to determine the top folder for the current page)
TopLevelFolders (to create your list of main folders)
You should be able to get MT to do anything you want/need it to, it may require creative thinking, but there's usually a way around things like this.
You can't have child pages of pages but you can have child folders of folders. If you do that you're getting into deep recursive territory and I never went that far!
Thanks Richard!
It's getting closer. I was able to get it to show the "current" folder at the top, and get it to show the pages within a nested folder.
Now my problem is that is lists the pages in a folder, and then the sub-folders. Ideally, I'd want to display the folder within the ascending list of pages, but I don't know if that is possible.
The other thing that I would like to do is to have the aunt/uncle pages and folders show in the left navigation, but since that would be a mix of folders and pages, I imagine that's not possible. Since I do have these showing in the main nav, I guess I can live with that.. :D
But it would be nice to show the folders and pages at the same level combined alphabetically...
current code...
And for some reason, I needed to indent the code twice in BBedit to get it to show as code.. go figure.. :-)
Would love to be able to see the code in this post. Would you be able to put it in a pastie? http://pastie.org/
Thanks!