Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2010-10-31 11:52:56

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [howto] Nested category->sub-category->article menu

Or, using the section_list tag:

<ul class="topnav">
	<txp:section_list break="li" active_class="active" sections=",about_us" include_default="1" default_title="Home">
		<txp:section title="1" link="1" />
	</txp:section_list>
	<txp:section_list break="li" active_class="active" sections="products">
		<txp:section title="1" link="1" />
			<txp:if_individual_article>
				<txp:article_custom category="products" wraptag="ul" break="li" class="subnav">
					<txp:permlink class='<txp:if_article_id>active</txp:if_article_id>'><txp:title /></txp:permlink>
				</txp:article_custom>
			<txp:else />
				<txp:article_custom category="products" wraptag="ul" break="li" class="subnav">
					<txp:permlink><txp:title /></txp:permlink>
				</txp:article_custom>
			</txp:if_individual_article>
	</txp:section_list>
	<txp:section_list break="li" active_class="active" sections="gallery,clients,contact-us">
		<txp:section title="1" link="1" />
	</txp:section_list>
</ul>

BTW, this forum is for ready-made how-tos, questions go in How do I… :)

Last edited by Els (2010-10-31 11:56:15)

Offline

#12 2010-10-31 12:02:56

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

Re: [howto] Nested category->sub-category->article menu

That’s getting clever Els. ;)

My only criticism is that I don’t think you need the comma in the “sections” for the first <txp:section_list /> block. I think you will end up with 2 default links. If you agree and modify the code you can delete this comment (you can do that can’t you?).


Stuart

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

Offline

#13 2010-10-31 15:42:19

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [howto] Nested category->sub-category->article menu

thebombsite wrote:

My only criticism is that I don’t think you need the comma in the “sections” for the first <txp:section_list /> block. I think you will end up with 2 default links. If you agree and modify the code you can delete this comment (you can do that can’t you?).

You are probably right about not needing the comma, to be honest I never tried to leave it out. But I’m absolutely sure that you won’t end up with two default links.
Dimitri can try both with and without the comma and let us know ;)

And I’m not going to delete your comment :P

Offline

#14 2010-10-31 17:12:08

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: [howto] Nested category->sub-category->article menu

Hi.

Sorry for wasting your time. I should have been more detailed, but i appreciate all your help, learnt alot from those new tags.
I have lot of experience in Expressionengine and the switch wasnt easy.

All the help you provided have resulted in something like this
<li class="active"><a href="http://localhost/era/index.php?s=about_us">About Us</a></li>

I have been trying to create something like this
<li><a class="active" href="http://localhost/era/index.php?s=about_us">About Us</a></li>

The active class is in different place.

My idea, i tried to do something like this below but it refuses to work
<li><txp:section name="home" class="<txp:if_section name="home">active</txp:if_section>">Home</txp:section></li>

Otherwise I have to modify my css and use this tag <li<txp:if_section name="home"> class="active"</txp:if_section>><txp:section name="home">Home</txp:section></li>

I am sad really but ,sigh, what can i do :)

Last edited by Dimitri (2010-10-31 17:17:41)


<txp:way_too_cool />

Offline

#15 2010-10-31 17:41:07

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [howto] Nested category->sub-category->article menu

Sorry, but did you try my example at all?

Offline

#16 2010-10-31 17:43:36

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [howto] Nested category->sub-category->article menu

Dimitri wrote:

My idea, i tried to do something like this below but it refuses to work
<li><txp:section name="home" class="<txp:if_section name="home">active</txp:if_section>">Home</txp:section></li>

That wouldn’t work, no. When using tags in tags, use single quotes:

<li><txp:section name="home" class='<txp:if_section name="home">active</txp:if_section>'>Home</txp:section></li>

Offline

#17 2010-10-31 18:09:56

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: [howto] Nested category->sub-category->article menu

That wouldn't work, no. When using tags in tags, use single quotes:

HIGH FIVE!!!, that what i needed from the beginning.

Sorry, but did you try my example at all?

Yes I tried everything but it wasnt something I was looking for. Thanx so much.


<txp:way_too_cool />

Offline

#18 2012-02-29 10:31:53

element
Member
Registered: 2009-11-18
Posts: 93

Re: [howto] Nested category->sub-category->article menu

How about 4 levels of navigation? I’m looking for a solution to this problem. Is it even possible?

Example:

Nav1
- Subnav1
- Subnav2
- Subnav3
-- Subsubnav1
-- Subsubnav2
--- Subsubsubnav1
- Subnav4
Nav2

Last edited by element (2012-02-29 10:32:49)

Offline

#19 2012-02-29 11:40:15

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,207

Re: [howto] Nested category->sub-category->article menu

element wrote:

How about 4 levels of navigation? I’m looking for a solution to this problem.

How about this one?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#20 2012-03-01 12:16:56

element
Member
Registered: 2009-11-18
Posts: 93

Re: [howto] Nested category->sub-category->article menu

Isn’t there a simpler solution? Seems awfully complicated.

Offline

Board footer

Powered by FluxBB