[HOWTO]add a footer navigation like NAV_LIST_TOP

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
tommi
Posts: 22
Joined: Tue 2. Mar 2004, 13:41

[HOWTO]add a footer navigation like NAV_LIST_TOP

Post by tommi »

Hi together, this forum is great! Many helpful hints and answers!
I hope I can help somebody,too by sharing my newbie-solutions with you!
:idea: Thats No.1, small tutorial :idea: :
How to add a footer navigation with a structure sublevel like {NAV_LIST_TOP}
Use: Want to create a horizontal navigation above the main block and one with the same
Outlook, but with a structure sublevel in the footer?

Problem: {NAV_LIST_TOP} and {NAV_LIST_TOP:homename:class} don’t allow to cat/target a substructure ID, so if you use them both in header bar and footer bar, you get the same.
Example:
Image
But we want:
Image
The footer navigation only displays the subcategory, in my example the countries shown in the
left nav table, too. But it could be any level depth!

How-to:
We will use the more flexible {NAV_LIST_CURRENT:show-index:index-name:list_class} for our needs in the footer navigation. This replacement tag doesn’t allow to target a specific ID either, but it lets me define the class that formats the navigation table. I want to have the same formatting like in the header navigation, so I use the css class list_top, default in tag {NAV_LIST_TOP}.

1. So add this replacement tag in your footer:
{NAV_LIST_CURRENT:0::list_top} //tells NAV_LIST_CURRENT to look like NAV_LIST_TOP
2. Open phpwcms_root\include\inc_front\front.func.inc.php
3. Go to line 1095: function css_list_top
4. Change:
function css_list_top($struct, $struct_path, $homelink="Home", $class="list_top", $link_to="index.php")
to:
function css_list_top($struct, $struct_path, $homelink="Home", $class="list_top", $link_to="index.php?id=20")
where ?id=20 is the category (“cat”) of the structure level that you want to show in the footer menu.
5. You can get the id by checking your page structure in PHPWCMS admin section by hovering the mouse pointer over the structure item “edit” minibutton. See it in your browser status line,
e.g. cat=20.

Now, you can create a substructure, for example:
“footer navigation”, status :hidden
sublevel “contact”,
“about us”
“impressum” and so on will be shown,
and you have the same handling like in the top navi bar, but with the categories you wish.



Hope this tutorial from a newbie helps others, too :D
Cheers, tommi
Last edited by tommi on Fri 12. Mar 2004, 10:35, edited 1 time in total.
tommi
Posts: 22
Joined: Tue 2. Mar 2004, 13:41

not very flexible...

Post by tommi »

hmm, can somebody tell us how this could be done "properly", lets say by implementing an alternate fuction?
Ciao, Tommi
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

your images are placed localhost - so we can´t see them!!
http://www.studmed.dk Portal for doctors and medical students in Denmark
cmslover
Posts: 86
Joined: Wed 18. Feb 2004, 16:17
Location: USA, Georgia, Atlanta
Contact:

Post by cmslover »

Hi Tommi,

Could you upload the images again? They don't show up :?
I want to try your tutorial out but I don't understand the concept yet. :oops:
tommi
Posts: 22
Joined: Tue 2. Mar 2004, 13:41

Shame on me :o)

Post by tommi »

:oops: how xcan I upload the images :oops:
HTought it would be uploaded from localhost.
I ccan't place it in a public place here.
Heeelp :wink:
tyr
Posts: 31
Joined: Tue 9. Dec 2003, 04:36
Location: Pennsylvania, USA

Post by tyr »

Tommi -- I just uploaded my images to my web site and linked to them from there. There may be another way, but linking to my website was quicker for me.
bobd314
Posts: 44
Joined: Tue 24. Feb 2004, 04:19

Post by bobd314 »

if any one want's something to hold some images go to http://wh0cares.com/script then the upload thingy, and it's a php file in there or it might be http://wh0cares.com/Scripts/Upload-Script... hold on ill go look..
ook
http://www.wh0cares.com/scripts/Upload- ... dmulti.php there ya go



http://www.wh0cares.com/scripts/Upload- ... dmulti.php
tommi
Posts: 22
Joined: Tue 2. Mar 2004, 13:41

Thanx Bobd!

Post by tommi »

Now everybody should see the pics, hope we all get input from this topic, since I know its not totally developped!
Cheers, tommi
vio
Posts: 16
Joined: Mon 10. May 2004, 19:55
Location: Hanoi, Vietnam

Post by vio »

I have other solution.You can use this funtion
function css_list_top($struct, $struct_path,$struct_id, $homelink="Home", $class="list_top", $link_to="index.php") {
.....
$top_struct = return_struct_level($struct, $struc_id)

}
Post Reply