Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-27 19:44:39

kevinpotts
Member
From: Kansas City
Registered: 2004-12-07
Posts: 364
Website

[request] relatively simple category / article navigation plugin (paid)

OK, maybe this can be solved by another plugin or easily though other means, but I have not found it in this forum or elsewhere. I can accomplish this with a convoluted set of native tags, but it’s massively inconvenient, and not at all scalable. Essentially, this is a navigation-focused plugin that would filter through a parent category, list all child categories, and then individual articles listed in those categories, all in nice and tidy nested lists. Here’s how the final result might appear:

  • Category A
    • article A1
    • article A2
    • article A3
    • article A4
  • Category B
    • article B1
    • article B2
    • article B3
    • article B
  • Category C
    • article C1
    • article C2
    • article C3
    • article C4

The one requirement is that an “active” state must be applied the <li> tag of whatever page is currently is being display, regardless of whether its a category or an individual page.

This plugin does not need to be complex. I could see the tag looking like this:

<txp:new_dreamplugin parent="services" active_class="active" />

That’s it. I would be more than willing to pay for the development of this. I’m hoping it’s something that can be easily done with mashup of category_list, rss_superarchive, and others.

Offline

#2 2008-09-27 20:23:08

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,223
Website

Re: [request] relatively simple category / article navigation plugin (paid)

Off the top of my head, could you not use txp:if_different and txp:article (which you know about ‘cause you wrote an article on it) together with smd_parent to fetch the parent for the if_different bit and rvm_if_this_article to detect if the current article.

Or maybe wow_menu does it all (not tried it myself but seems to have sub-category support).

(For a non-nesting version I’ve used mah_lib_category_array before with an additional function for the output I wanted – in that case a select list.)

Last edited by jakob (2008-09-27 20:25:30)


TXP Builders – finely-crafted code, design and txp

Offline

#3 2008-09-27 22:18:57

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: [request] relatively simple category / article navigation plugin (paid)

Kevin,

I’m just about to release a new version of adi_menu that will output articles in the navigation menu. However, the closest it comes to your requirement is:

  • Section A
    • Article A1
    • Article A2
    • Article A3
  • Section B
    • Article B1
    • Article B2
    • Article B3
  • Section C
    • Article C1
    • Article C2
    • Article C3

If you don’t find a suitable method of implementing your category menu then let me know – there’s probably quite a bit of adi_menu code that could be reused.

Cheers,

Adi

P.S. The Textpattern Solutions book was what really swung it for me when I was researching different CMSs. Thanks.

Offline

#4 2008-09-28 01:30:26

kevinpotts
Member
From: Kansas City
Registered: 2004-12-07
Posts: 364
Website

Re: [request] relatively simple category / article navigation plugin (paid)

jakob wrote:

Off the top of my head, could you not use txp:if_different and txp:article (which you know about ‘cause you wrote an article on it) together with smd_parent to fetch the parent for the if_different bit and rvm_if_this_article to detect if the current article.

I have tried different combinations of if_different without any real luck. I looked at smd_parent but do not understand how it will help; I all also using glx_hl_current to detect the current article, but that only works for individual articles, not category pages. They big hangup is being able to detect the active page and assign a class of “active” to the <li> element for styling.

Or maybe wow_menu does it all (not tried it myself but seems to have sub-category support).

Tried it. Not what I’m looking for.

I have seen this question raised before in the forums, without any conclusive solutions. I have done this before for a different site, but it was such a lengthy, bloated solution that I probably would have abandoned the project if it were not for a paying client. My goal is to create a dynamic solution, so when the client ultimately creates a new category and associated articles, it will appear in the menu without hacking though nested forms. I am just really surprised that this plugin does not exist; looking through what’s available, it seems as if everything but this functionality exists.

gomedia wrote:

If you don’t find a suitable method of implementing your category menu then let me know – there’s probably quite a bit of adi_menu code that could be reused.

This is really close to what I need; substitute categories for section and it’s money. Speaking of money, interested in creating an alternate version on the side?

Thanks for the quick responses everyone.

Offline

#5 2008-09-28 02:00:48

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: [request] relatively simple category / article navigation plugin (paid)

kevinpotts wrote:

This is really close to what I need; substitute categories for section and it’s money. Speaking of money, interested in creating an alternate version on the side?

Sure thing. Sounds like an interesting project. Besides, I might need it myself one day! Let’s talk: contact me using forum mail or via my website.

Offline

#6 2008-09-28 07:39:14

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,267
Website

Re: [request] relatively simple category / article navigation plugin (paid)

This would work in 4.0.7:

<!-- first level: all subcategories of 'parent' -->

<txp:category_list parent="parent" exclude="parent" wraptag="ul" break="li" > 


<!-- determine classname for first level list items depending on the current URI category. Use txp:variable as a scratchpad  -->

<txp:variable name="catclass" value="passive" />
<txp:if_category name='<txp:category />'>
  <txp:variable name="catclass" value="active" />
</txp:if_category>

<!-- first level list item: category link -->

<txp:category title="1" link="1" class='<txp:variable name="catclass" />' />


<!-- second level: all articles of the current category list item, sorted by title ascending -->

<txp:article_custom category='<txp:category />' wraptag="ul" break="li" sort="title asc">


<!-- determine classname for second level list items depending on the current article id. Use another txp:variable as a scratchpad  -->


<txp:variable name="artclass" value="passive" />
<txp:if_article_id>
  <txp:variable name="artclass" value="active" />
</txp:if_article_id>


<!-- second level list item: article permlink -->

<txp:permlink class='<txp:variable name="artclass" />'><txp:title /></txp:permlink>


<!-- finish for each level 2 item -->

</txp:article_custom>

<!-- finish for each level 1 item -->

</txp:category_list>

no plugin required, self-maintaining.

Offline

#7 2008-09-28 08:50:59

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: [request] relatively simple category / article navigation plugin (paid)

There goes the Ferrari … :-(

Offline

#8 2008-09-28 11:41:03

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,223
Website

Re: [request] relatively simple category / article navigation plugin (paid)

This would work in 4.0.7

Lovely. Both category_list as well as article_custom as container tags, and nested.


TXP Builders – finely-crafted code, design and txp

Offline

#9 2008-09-28 12:38:43

kevinpotts
Member
From: Kansas City
Registered: 2004-12-07
Posts: 364
Website

Re: [request] relatively simple category / article navigation plugin (paid)

wet wrote:

This would work in 4.0.7:

I love it. Sound logic and native to TXP. However, when is 4.0.7 being released? I kinda need something now, and since this is for a client, I am developing on the official 4.0.6.

Offline

#10 2008-10-09 10:16:41

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: [request] relatively simple category / article navigation plugin (paid)

Plugin adi_cat_menu created in response to Kevin’s original requirement.

Offline

Board footer

Powered by FluxBB