How can I get nav like LOCALNAV from content pgs?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
rtilghman
Posts: 107
Joined: Tue 1. Mar 2005, 17:22

How can I get nav like LOCALNAV from content pgs?

Post by rtilghman »

Just like the subject line states, I want to generate a UL/LI list for pages at a certain level (more or less just like LOCALNAV) but I want it to draw from the content pages in a site level rather than the sub-levels beneath the current level. Make sense?

For example, if I had "Section A" with four articles in it "Article 1", "Article 2", etc. I would have the following with navigation:

<ul>
<li class="activeclass">Article 1 Title</li>
<li>Article 2 Title</li>
<li>Article 3 Title</li>
<li>Article 4 Title</li>
</ul>

Is there some existing way to do this that I'm missing? Is there some easy way to make a replacement tag using the existing LOCALNAV code? I tried looking for the code that generates the LOCALNAV menu but I came up with nothing in a quick recursive FIND for the tag...

Anyone have any insight?

Thanks,
Rick
mscwd
Posts: 21
Joined: Tue 26. Jul 2005, 21:23

Post by mscwd »

This is what I want to figure out. Basically if you have a site structure of:

About -> History -> Team -> Offices

A menu such as this: http://www.phyora.com/misc/phymenu.htm would be automatically generated, and new article links added to it when/if they were created.

I think this is what you were asking for rtilghman, if its not sorry for crashing your thread. :wink:

Any help with this would be appreciated,

-mscwd
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

mscwd wrote:This is what I want to figure out. Basically if you have a site structure of:

About -> History -> Team -> Offices

A menu such as this: http://www.phyora.com/misc/phymenu.htm would be automatically generated, and new article links added to it when/if they were created.

I think this is what you were asking for rtilghman, if its not sorry for crashing your thread. :wink:

Any help with this would be appreciated,

-mscwd
just place this in frontend render

Code: Select all

<?php 
// ------------------------------------------------------------- 
if( ! ( strpos($content["all"],'{DROPDOWN')===false ) ) { 
$content["all"] = str_replace('{DROPDOWN}', '{DROPDOWN:0}', $content["all"]); 
$replace = 'build_dhtmlmenu( "$1","", 0);'; 
$content["all"] = preg_replace('/\{DROPDOWN:(\d+)\}/e', $replace, $content["all"]); 
} 
// ------------------------------------------------------------- 
?> 
and place {DROPDOWN} where you want it... then add the css settings you want to use to frontend.css
http://www.studmed.dk Portal for doctors and medical students in Denmark
Post Reply