Page 1 of 1

navigation within same page with tabs [solved]

Posted: Tue Dec 17, 2013 7:06 pm
by babel
I can't get this working in my template. There is a main navigation, but as soon as put this tab navigation for content on the same page, the page turns in a mess. If I look at the page source it shows the right codes. What am I doing wrong?
<div class="nav_jaar">
<ul>
<li class="active"><a href="#jaar_1911" title="#">1911</a></li>
<li><a href="#jaar_1925" title="#">1925</a></li>
<li><a href="#jaar_1939" title="#">1939</a></li>
<li><a href="#jaar_1942" title="#">1942</a></li>
<li><a href="#jaar_1961" title="#">1961</a></li>
<li><a href="#jaar_1982" title="#">1982</a></li>
<li><a href="#jaar_1989" title="#">1989</a></li>
<li><a href="#jaar_2002" title="#">2002</a></li>
<li><a href="#jaar_2011" title="#">2011</a></li>

</ul></div>

It would be nice if someone has the answer.

Re: navigation within same page with tabs

Posted: Wed Dec 18, 2013 2:20 am
by applejack
Try {$page_alias}/#jaar_

Re: navigation within same page with tabs

Posted: Wed Dec 18, 2013 5:42 am
by babel
Thanks applejack. Your suggestion makes the page look as it should, but if I click on the tab, it doesn't jump to the year. I hope you know what code is left out.

Re: navigation within same page with tabs

Posted: Wed Dec 18, 2013 6:41 am
by staartmees
you did put an anchor before each year?

Code: Select all

<a name="1911">1911</a>

Re: navigation within same page with tabs

Posted: Wed Dec 18, 2013 8:24 am
by velden
Consider posting a link so we can see what does happen.

<a name=""...> could be obsolete depending on your document type.

Re: navigation within same page with tabs

Posted: Wed Dec 18, 2013 10:44 am
by applejack
Sorry try this.

/{page_alias}#

or {$smarty.server.REQUEST_URI}#

Re: navigation within same page with tabs

Posted: Tue Jan 28, 2014 9:34 am
by babel
Applejack, thanks a lot: {$smarty.server.REQUEST_URI}# works wunderfull. :) 8)

Velden, I can't post a link because it's on my wamp-server.

Re: navigation within same page with tabs [solved]

Posted: Tue Jan 28, 2014 2:58 pm
by HarmO
For the record:

The {metadata} tag adds a <base>-tag in HTML and that is probably the reason why your first code didn't work.

if you used {metadata showbase='false'} in you template, your first code would have worked correctly.