Member
Member
gwmbox   2009-06-29, 00:32
#1

Hi, I am trying to figure it out but so far no setting or luck on thsi one (yet).

I have got a top level page and a series of sub-level pages. The pages are all published but they are only displayed in the menu when the top level page is activated. How can I change it so that the sub-poages are always shown?

Cheers

Member
Member
sbillard   2009-06-29, 01:54
#2

I am assuming you are using the printPageMenu() function. Unfortunately, it does not provide an option to do just what you wish. You would have to create a custom function to do that. You should be able to copy the existing printPageMenu() function from the zenpage-template-functions.php script. The calculaton that sets $process is what you want to change. If you just set $process to true, all pages will be shown. If you want something more selective than that, you will have to code the conditions.

Member
Member
gwmbox   2009-06-29, 02:49
#3

Ok, I am assuming you mean this part

foreach (&#36;pages as &#36;page) { &#36;pageobj = new ZenpagePage(&#36;page['titlelink']); &#36;level = max(1,count(explode('-', &#36;pageobj->getSortOrder()))); &#36;process = ((&#36;option == 'list' || &#36;option == 'list-top') && &#36;level==1 // show the top level || ((&#36;option == 'list' || (&#36;option == 'omit-top' && &#36;level>1)) && ((&#36;pageobj->getID() == &#36;pageid) // current page || (&#36;pageobj->getParentID()==&#36;pageid) // offspring of current page || (&#36;level 1 && strpos(&#36;pageobj->getSortOrder(), &#36;myparentsort) === 0)) // direct ancestor ) || (&#36;option == 'list-sub' && (&#36;pageobj->getParentID()==&#36;pageid) // offspring of the current page ) ); if (&#36;process) { if (&#36;level > &#36;indent) { echo "\n".str_pad("\t",&#36;indent,"\t")."\n"; &#36;indent++; &#36;parents[&#36;indent] = NULL; &#36;open[&#36;indent] = 0; } else if (&#36;level < &#36;indent) { &#36;parents[&#36;indent] = NULL; while (&#36;indent > &#36;level) { if (&#36;open[&#36;indent]) { &#36;open[&#36;indent]--; echo "\n"; } &#36;indent--; echo str_pad("\t",&#36;indent,"\t")."\n"; } } else { // level == indent, have not changed if (&#36;open[&#36;indent]) { // level = indent echo str_pad("\t",&#36;indent,"\t")."\n"; &#36;open[&#36;indent]--; } else { echo "\n"; } }
Not really sure part to edit, but I am thinking the &#36;level > &#36;indent part but not sure?

Administrator
Administrator
acrylian   2009-06-29, 07:41
#4

I really thought we added this option for both the printAlbumMenu() (which already has it) and printPageMenu(). Anyway this option should be there so I will see to add it soon.

Member
Member
sbillard   2009-06-29, 15:40
#5

As to the answer to your question. To show all pages, change the &#36;process line to &#36;process=true. To show all pages to nesting level x change the line to say &#36;process = &#36;level

Member
Member
gwmbox   2009-06-29, 16:00
#6

How easy was that - cheers for the quick solution

Administrator
Administrator
acrylian   2009-06-29, 16:21
#7

Tonight's nightly will also have the parameter &#36;showsubs for this.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.