WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: david doc watson on December 03, 2010, 02:08:22 PM

Title: Linking to an anchor from the main menu
Post by: david doc watson on December 03, 2010, 02:08:22 PM
Using WB v 2.8.1 Rev 1287

I have a series of pages that use a different template and navigation to the rest of the site:

http://www.sweetwoodspark.com/pages/the-course/hole-by-hole-guide.php
 (http://www.sweetwoodspark.com/pages/the-course/hole-by-hole-guide.php)

Clicking the page links 1, 2, 3 ... etc. reloads the page and takes you to the top of the target page. I would like to be able to add an achonr in index.php and target the menu to go to that anchor on each page when a page is selected in the menu.

Any help in solving this would be appreciated .

Thanks

David "Doc" Watson
Title: Re: Linking to an anchor from the main menu
Post by: Argos on December 06, 2010, 11:26:48 AM
Very nice site!

Regarding you question, I presume the submenu is done with showmenu2(). Based on the info on http://www.websitebakers.de/sm2/media/README.en.txt, I guess you can just put the anchorname after the link in the $aItemOpen part. If your anchor is #holedescription, use a showmenu like:

Code: [Select]
show_menu2(
        $aMenu          = 0,
        $aStart         = SM2_ROOT,
        $aMaxLevel      = SM2_CURR+1,
        $aOptions       = SM2_TRIM,
        $aItemOpen      = '[li]<a href="[url]#holedescription">[menu_title]</a>',
        $aItemClose     = '</li>',
        $aMenuOpen      = '[ul]',
        $aMenuClose     = '</ul>',
        $aTopItemOpen   = false,
        $aTopMenuOpen   = false
        )

Not tested!
Title: Re: Linking to an anchor from the main menu
Post by: david doc watson on December 08, 2010, 01:51:25 PM
Hi Argos,

Thanks for your kind comments! Nice CMS by the way!

Yes it is built using showmenu2(). That makes sense, I'll give it a go a report back.
Title: Re: Linking to an anchor from the main menu
Post by: david doc watson on December 08, 2010, 02:48:54 PM
Thanks - worked a charm.
Title: Re: Linking to an anchor from the main menu
Post by: Argos on December 08, 2010, 03:07:58 PM
Nice  :-D
Title: Re: Linking to an anchor from the main menu
Post by: instantflorian on December 08, 2010, 05:00:57 PM
Hi,

for a 1920x1200 screen resolution the background image is too small. Beside this it's a very nice impressive site.

BR
-instantflorian.

[gelöscht durch Administrator]