Page 1 of 1

How to use {NAV_TABLE_COLUMN:[sectionID]} dynamically?

Posted: Sun 26. Sep 2004, 13:35
by jamba
I would like to use the {NAV_TABLE_COLUMN:1} replacement tag so that I can have subcategories displayed when you click on each section. The {NAV_TABLE_COLUMN:1} replacement tag will produce a menu of each subsection of ID 1, but how do can I make this generate according to the section you're in?
Example:
About us
- Privacy
- Conditions
- Contact
Services
- Design
- Production
- Testing
When you're looking at any page within the About us section, I'd like the nav to show all 3 subsections on the left. Likewise when in Services, I'd like each of the 3 Services subsections shown.

Any ideas :?

Posted: Sun 26. Sep 2004, 15:11
by argos
If I understand correctly what you mean is the same as I did on http://www.argosmail.net

If so, then do this:

Create a different template for each section, so one for About Us and one for Services. The templates only differ in the number in {NAV_TABLE_COLUMN:1}. Assign each category their own template.

Posted: Sun 26. Sep 2004, 15:16
by jamba
Thanks, argos.

I thought if this but was hoping there was a more intuitive way around it. I guess that's what I'll have to do.

Posted: Sun 26. Sep 2004, 15:19
by jsw_nz
Hi Jamba, You need to get the 'site structure' integer and create separate templates based on these. For example

Code: Select all

{NAV_TABLE_COLUMN:12}
{NAV_TABLE_COLUMN:8}
etc 


"This integer can be found by rolling your cursor over the site structure icons in the admin-site structure section. Using this parameter, menus are generated from this site structure level and below."

from:

http://docu.fhss.de/navigation_tags.phtml

Hope this helps.....

Posted: Sun 26. Sep 2004, 19:12
by Oliver Georgi
check file in "sample_ext_php/nav.php".

There you can find a solution to get the ID of a parental structure - like when using a breadcrumb menu.

Then only 1 template for everything is neccessary (often).

Oliver

Posted: Sun 26. Sep 2004, 22:52
by jsw_nz
Hi Oliver....Nice feature which I had never looked into. So basically, if you don't mind doing a little hard-coding, then putting expression in a given page template:

Code: Select all

{PHP:sample_ext_php/nav.php}
will return the 'dynamic' context sensitive menu.
Nice, maybe this needs to be documented a little more on the docu.fhss.de site.

cheers,
john

Posted: Thu 7. Oct 2004, 17:01
by Flinti
hi

I've tried the nav.php. I am using for my main navigation

Code: Select all

{NAV_ROW}
and for my left navigation

Code: Select all

{PHP:sample_ext_php/nav.php}
from oliver.
Now lets say my site structure looks like this:

a
.aa
.ab
.ac
b
.ba
.bb
.bc

a and b are used by {NAV_ROW} and .aa .ab and so on are used by nav.php. Now when my left navi is like this:

.aa
.ab
.ac

and then i click on .aa or .ab or so, my left navigation disapears... but i would like that it stays. How could i fix this problem? is it even possible by using sample_ext_php/nav.php ? or must i do it by using NAV_TABLE_COLUMN:X}? (but i would like to do it with only one template)

thx for any help

Posted: Fri 8. Oct 2004, 08:42
by Flinti
kann man in sample_ext_php/nav.php eine abfrage einbauen, die schaut ob der jeweilige menüpunt ein untermenü besitzt?

wäre um jede hilfe dankbar.

Posted: Mon 15. Nov 2004, 16:24
by Jimmy_Jazz
Oliver Georgi wrote:check file in "sample_ext_php/nav.php".

There you can find a solution to get the ID of a parental structure - like when using a breadcrumb menu.

Then only 1 template for everything is neccessary (often).

Oliver

Hi

Ive created a graphics based navigation and used the nav.php example to make it dynamic as suggested by Oliver. It works fine. However is there any way of grouping some cases - if you would like several categories to echo the same line of code rather than having to duplicate the same lines of code?

i.e

case 1 & 2 & 3 :
echo '<img src="template/head/agenda.gif" width="131" height="19" alt="Agenda" />';
echo '{NAV_TABLE_COLUMN:1}';
break;

Sorry if this is a stupid question but my php isnt very good although i understand a little.


Thanks

Posted: Tue 23. Nov 2004, 16:23
by Gnolen
Yeah, this is a great solution but when I make one the subcategories doesn't display the colomn. How can I resolve this?

It wouldn't be a problem if I could do like Jimmy_Jazz wrote 'case 1 & 2 & 3 :'
and so on..

But this would still be a problem when clients add a page...

Any idees anyone?

Greetings from

Martin

Posted: Sat 4. Dec 2004, 15:42
by leone
Try this, enter in nav.php before the switch statement:

Code: Select all

while ( $GLOBALS['content']['struct'][$check_id]['acat_struct'] > 0 ) {
	$check_id = $GLOBALS['content']['struct'][$check_id]['acat_struct'];
}

switch($check_id) {

	case 1:		//level1
			echo '<img src="template/head/agenda.gif" width="131" height="19" alt="Agenda" />';
			echo '{NAV_TABLE_COLUMN:1}';
			break;
			
	case 2: 	//level2
			echo '<img src="template/head/events.gif" width="131" height="19" alt="Events" />';
			echo '{NAV_TABLE_COLUMN:2}';
			break;

.......

This will cause the program to find the topmost menu before the index menu (0) in any case. This will always show the full left menu, regardless of what level you descend into.

regards,
Leone

Posted: Tue 7. Dec 2004, 13:20
by Jimmy_Jazz
Hi Leone

This is just what i needed but when i replace the code i get the following error:

Parse error: parse error, unexpected T_STRING in /home/wallcrea/public_html/loopdream/sample_ext_php/nav.php on line 35


line 35 is the second line of your replacement code.

Any ideas?

RE

Posted: Thu 9. Dec 2004, 09:39
by gogoguerilla
I ran into the same problem as Jimmy.. any follow-ups?

Thanks!