WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Linking to an anchor from the main menu

(1/2) > >>

david doc watson:
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


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

Argos:
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: ---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
        )
--- End code ---

Not tested!

david doc watson:
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.

david doc watson:
Thanks - worked a charm.

Argos:
Nice  :-D

Navigation

[0] Message Index

[#] Next page

Go to full version