Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

els
Moderator
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
Moderator
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
Moderator
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: 99

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,303

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: 99

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

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

Offline

#21 2012-03-01 17:34:30

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

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

No, the solution is pretty simple. It only looks complicated because of the repetition of the same elements for every level. Just do it :)

I used it here advokathamburg.de (navigation in left sidebar) and even I understood the data flow.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#22 2012-08-22 09:31:47

husainhk
Member
From: Dubai, UAE
Registered: 2007-08-12
Posts: 105
Website

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

Hey Markus … I too need a multi-level category menu, but without articles, just like your implementation on http://advokathamburg.de/. Care to share the code needed for this? Thanks so much!

Offline

#23 2012-08-22 09:35:14

husainhk
Member
From: Dubai, UAE
Registered: 2007-08-12
Posts: 105
Website

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

Ignore me … Sorry, just saw the note on TXP Tips, on what to do when no articles are required :-)

Offline

#24 2014-01-22 21:40:38

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

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

element wrote #258592:

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

Before I forget this dirty hack:

<!-- tree form -->
<txp:category title="1" />
<txp:category_list parent='<txp:category />' exclude='<txp:category />' children="0" wraptag="ul" break="li">
	<txp:php>echo parse(fetch_form('tree'));</txp:php>
</txp:category_list>

<!-- nested menu -->
<txp:category_list children="0" wraptag="ul" break="li" form="tree" />

Offline

Board footer

Powered by FluxBB