Navigation

Pligg Support

When I add a new page from the admin panel it doesn't dynamically add to the navigation bar. I've had to go into the header.tpl file to manually enter it.
Two issues I'm having:
1. Is there a way to use smarty code for the ahref to the page?
2. For the if statement to set the page to active I only have the option of $pagename eq "page" for it work with a custom page. However I have more than one custom page so they are all showing as active. Is there a different variable I could use? I try writing in the page name I've assigned but it doesn't work.

Possible Answers

    The smarty variable {$get.page} will return the page's url value. So if you have a page at sample.com/static/demo/ then it would return a value of 'demo'.

    If you need to determine if the current page is the 'demo' page, for the purposes of highlighting an active menu tab, then you could use code like this:

    http://pastebin.com/raw.php?i=mWTqyFQj

    If you want to add a link to your page near the end of your main navigation bar (the blue bar across the top of bootstrap), then I suggest using that line of code in header.tpl just above the line that contains the module hook: {checkActionsTpl location="tpl_pligg_navbar_end"}

    | Posted 75 days ago | Permalink | Hide Replies

Who Upvoted this Story