navigation within same page with tabs [solved]

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

navigation within same page with tabs [solved]

Post 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.
Last edited by babel on Tue Jan 28, 2014 9:56 am, edited 1 time in total.
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: navigation within same page with tabs

Post by applejack »

Try {$page_alias}/#jaar_
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

Re: navigation within same page with tabs

Post 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.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: navigation within same page with tabs

Post by staartmees »

you did put an anchor before each year?

Code: Select all

<a name="1911">1911</a>
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: navigation within same page with tabs

Post by velden »

Consider posting a link so we can see what does happen.

<a name=""...> could be obsolete depending on your document type.
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: navigation within same page with tabs

Post by applejack »

Sorry try this.

/{page_alias}#

or {$smarty.server.REQUEST_URI}#
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

Re: navigation within same page with tabs

Post 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.
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: navigation within same page with tabs [solved]

Post 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.
Kind regards,
HarmO
Post Reply

Return to “Layout and Design (CSS & HTML)”