Experiment in 2-tier nested menu/page

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

Experiment in 2-tier nested menu/page

Postby xzjia » Mon Nov 02, 2009 10:22 pm

Edit: Problem solved, see here

I was just playing around, trying to see if I can wrestle PivotX in its current state into having nested pages (with the associated nested menu).

My target was to be able to set up two tiered nested pages (as is the most common).

Level 1: Page
--- Level 2: SubPage
--- Level 2: SubPage
--- Level 2: SubPage

Now of course PivotX doesn't have nested page feature, but I figured that I might be able to use Chapters to "fake" an upper level page by using the code mentioned here as the base.

hansfn wrote:
Code: Select all
<ul>
[[ pagelist
  chapterbegin="<li>%chaptername%<ul>"
  pages="<li><a href='%link%' title='%subtitle%'>%title%</a></li>"
  chapterend="</ul></li>"
]]
</ul>

With that I can get a menu with:

Level 1: Chapter {no link}
--- Level 2: Page
--- Level 2: Page
--- Level 2: Page

But of course that's not really a nested page, its a group of pages with a label, so somehow the Chapter needs a page associated to it, so I thought why not...

Level 1: Chapter Name { link = Page X }
--- Level 2: Page
--- Level 2: Page
{ Exclude = "Page X" }

... basically hijack a certain page X from pages, and link it to the chapter itself, while hiding it from the rest of its brothers.

So hey, now we have nested pages! Except...

  1. Need to somehow pass the %link% parameter into the chapterbegin="" parameter to get the Chapter link to actually work.
  2. Exclude="" only seems to accept Titles, but having multiple pages with the same title messes PivotX up if you're using the auto-generated internal path - even when they are in different chapters. So editing the internal names to avoid collision is necessary right now.
  3. Finally there's no way to detect active chapter using the isactive parameter right now, which kinda sucks.

Just to clarify, this is just a documentation of my dead-ended attempt to get a nice-to-have feature to work, so I'm leaving what I got here in case it prove useful to anyone. Of course, if proper page hierarchy / nesting is implemented none of this is needed.
Last edited by xzjia on Sat Nov 28, 2009 3:54 pm, edited 1 time in total.
xzjia
 
Posts: 110
Joined: Tue Dec 11, 2007 6:26 pm

Re: Experiment in 2-tier nested menu/page

Postby rabbeltje » Tue Nov 03, 2009 7:47 am

isn't this what is sortof already done here and here?
User avatar
rabbeltje
 
Posts: 358
Joined: Mon Aug 25, 2008 11:54 am
Location: Neerbeek, The Netherlands

Re: Experiment in 2-tier nested menu/page

Postby xzjia » Wed Nov 04, 2009 2:18 pm

rabbeltje wrote:isn't this what is sortof already done here and here?


Your kidding me... gahhhh search you failed me again!
xzjia
 
Posts: 110
Joined: Tue Dec 11, 2007 6:26 pm


Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron