Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-02-24 20:35:20
- pgregg
- Member
- From: UK
- Registered: 2006-02-16
- Posts: 20
(new user) Problem with nav buttons
Hi all,
Forgive me if the answer to this is obvious to you experts! I am new to txp and new to CSS (oh no I hear you say). I downloaded an excellent template from Andreas Viklund but can’t get the nav buttons to work properly. You will see that the Home button remains light blue whatever section I am in. i.e. the relevant button should turn light blue depending on the visited section. Hope that makes sense!!
http://www.2425atc.org.uk
I hope you can help me.
I think the relevant code is here in the page
<code>
<div id=“navigation”>
<ul>
<li class=“selected”>
<a href=”<txp:site_url />index.php”>Home</a></li>
<li><a href=”<txp:site_url />about”>About</a></li>
<li><a href=”<txp:site_url />article”>News</a></li>
<li><a href=”<txp:site_url />gallery”>Gallery</a></li>
<li><a href=”<txp:site_url />events”>Events</a></li>
<li><a href=”<txp:site_url />admin”>Admin</a></li>
<li><a href=”<txp:site_url />cadets”>Cadets</a></li>
<li><a href=”<txp:site_url />fun”>Fun</a></li>
<li><a href=”<txp:site_url />links”>Links</a></li>
<li><a href=”<txp:site_url />contact”>Contact</a></li>
</ul>
</div>
</code>
and CSS here
<code>
#navigation{
height:2.2em;
line-height:2.2em;
width:758px;
margin:0 1px;
background:#578bb8;
color:#ffffff;
}
#navigation li{
float:left;
list-style-type:none;
border-right:1px solid #ffffff;
white-space:nowrap;
}
#navigation li a{
display:block;
padding:0 10px;
font-size:0.8em;
font-weight:normal;
text-transform:uppercase;
text-decoration:none;
background-color:inherit;
color: #ffffff;
}
- html #navigation a {width:1%;}
#navigation .selected,#navigation a:hover{
background:#80b0da;
color:#ffffff;
text-decoration:none;
}
</code>
Thank you.
Phil
Offline
#2 2006-02-24 20:43:57
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: (new user) Problem with nav buttons
Just for future reference, the troubleshooting form is for reporting problems with Textpattern itself (errors, etc). This kind of question would be good for the “How do I?” or “Layout & CSS Discussion” forums. But as I said, just for future reference. :)
Your links are not getting highlighted because you haven’t told Textpattern to care. Note the class="selected"
is set to your home page, so it will always highlight the home page link. What you need to do is something like this (I tried pasting the code here, but it just gets cut off). Here’s a reference for the if_section tag.
Last edited by Mary (2006-02-24 20:49:02)
Offline
#3 2006-02-24 21:42:04
- pgregg
- Member
- From: UK
- Registered: 2006-02-16
- Posts: 20
Re: (new user) Problem with nav buttons
Mary, I am so grateful to you. The site is now working. Thank you for taking the time to write the code for me. I apologise for choosing the wrong section on the forum and will try to choose the right one next time :)
Regards,
Phil
Offline
Pages: 1