Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-29 23:31:20

yaform
Member
From: Lund, Sweden
Registered: 2005-11-03
Posts: 20
Website

selected sections highlighted in navbar

Hello. Im a wordpress jumper that would like to try this out. I installed a theme – MX4. Modded it some.

Now, I wonder if there is a way to highlight the section you enter, instead of having “home” or in my case “HEM” highlighted all the tim? For example, if u look at my site http://yaform.se – what ever section u choose in the navbar – “HEM” is always highlighted. I have made static pages for “print // webb” and “kontakt” – but when you enter the sections “HEM” is still highligted, not the section bar u just entered.

Is there a way the let the higlightening follow the choosen section?


all we need is some creactivism

Offline

#2 2005-11-30 00:38:15

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: selected sections highlighted in navbar

yaform,
Its easy to just ask questions without searching too much :)

Try this thread.

Make sure to really check around. There are TONS of answers already in the forum and this is a repeat ten-twenty times over.

:) Hope that helps,

Matthew


Offline

#3 2005-12-17 23:30:07

andymiller
Member
Registered: 2005-12-05
Posts: 17

Re: selected sections highlighted in navbar

Hmm there may be tons of answers but also tons of different questions. That thread doesn’t seem to answer the question about how to highlight the ‘active’ section.

I’m new to to TXP and I haven’t had time to play with this but I think the answer may be in using <txp:if_section> to programme TXP to put the links to the current page into a separate div which you could then style separately from the rest of the navigation.

Alternatively use the method in the 456 Berea St article.

Offline

#4 2005-12-17 23:35:12

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: selected sections highlighted in navbar

Post #2 doesn’t do it for you?

Offline

#5 2005-12-17 23:47:58

andymiller
Member
Registered: 2005-12-05
Posts: 17

Re: selected sections highlighted in navbar

D’Oh. (It’s late at night here).

I must check out the plug-in at http://www.ako-k.com/archive/108

Offline

#6 2005-12-18 01:14:49

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: selected sections highlighted in navbar

If the link takes you to a section you can use the <code><txp:if_section name=“sectionName”><txp:else /></txp:if_section></code> tags to give active and non-active CSS code to the link.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#7 2005-12-18 16:16:54

yaform
Member
From: Lund, Sweden
Registered: 2005-11-03
Posts: 20
Website

Re: selected sections highlighted in navbar

Matthew,

it is also very easy to say that all questions allready are answered if you are a very experienced user. Im a true newbie. I have looked around and searched a lot, and read that and more threads at the same issue – but still I couldnt figure it out my way (without making new Page for each section). Actually, I still have not found the answer – but at last I made more pages – and then could follow the instructions at different threads.

Guess it looked to you as I was acting like an spoiled kid that just asking around and want the answers – but I am not. I have put some effort in seaching.

Anyways – thanks for giving me an already read thread, although it was not the right for me.

Take it easy on us newbies. altough we are not that :cool: as you. :)

By the way – I loved your endquote!

Thanx everybody else – as you might see – I got it work with a new page for each section.

> ma_smith wrote:

> yaform,
> Its easy to just ask questions without searching too much :)

> Matthew

Last edited by yaform (2005-12-18 16:26:08)


all we need is some creactivism

Offline

#8 2005-12-18 19:38:43

andymiller
Member
Registered: 2005-12-05
Posts: 17

Re: selected sections highlighted in navbar

Stuart

If I’m being a bit slow please be gentle with me. Supposing you had a site with four sections. Could you construct the navigation like this:

<code> <ul> <txp:if_section name=“Home”><li class=“activesection”><txp:else /><li class=“navigation”><txp:link_to_home>Home</txp:link_to_home> <txp:if_section name=“About”><li class=“activesection”><txp:else /><li class=“navigation”><txp:section link=1 title=1 name=“About” /></li> <txp:if_section name=“Contact”><li class=“activesection”><txp:else /><li class=“navigation”><txp:section link=1 title=1 name=“Contact” /></li>
<txp:if_section name=“Photos”><li class=“activesection”><txp:else /><li class=“navigation”><txp:section link=1 title=1 name=“Photos” /></li>
</ul></code>

and then set up the appropriate statements for the different type of list item.

Not sure if this is the best way to do it. Might be better to have a surrounding div and then define the attributes of list items within that – would avoid having to use <code><txp:else />.

Anyway. Is this obviously mad or stupid?

Offline

#9 2005-12-18 23:14:54

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: selected sections highlighted in navbar

You need to close the if_section tags so:-

<code>
<txp:if_section name=“Home”>
<li class=“activesection”>
<txp:else />
<li class=“navigation”>
</txp:if_section>
<txp:link_to_home>Home</txp:link_to_home></li></code>
<br />

and repeat that format for each link. I assume you have a section called “Home”. If you really mean the default section then use name=”“.

Last edited by thebombsite (2005-12-18 23:15:52)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#10 2005-12-18 23:22:12

andymiller
Member
Registered: 2005-12-05
Posts: 17

Re: selected sections highlighted in navbar

OK great. I’ll give that a whirl.

Thanks for the tip about the default page – that’s probably saved me a lot of heartache.

Thanks a lot.

Offline

#11 2006-01-01 13:44:50

-P-
Member
From: Finland
Registered: 2005-09-10
Posts: 211

Re: selected sections highlighted in navbar

I feel I´m quite skilled in making sites and styling them with css. I have tested ako_nav but I´d need something to work with individual articles meaning not relying on sections.
Also tested with what Stuart posted, no success. Feeling like a complete idiot here and I need a detailed demo how to do this. If somebody volunteers, I´m even willing to pay. Please help! :)

Last edited by -P- (2006-01-01 13:46:13)

Offline

#12 2006-01-01 16:12:57

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: selected sections highlighted in navbar

I’ve been paid thank you. Where do the “individual articles” come in?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB