Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[plugin] [ORPHAN] zoo_section_and_category_list
Hi all,
Here’s my first plugin: zoo_section_and_category_list
Here’s an idea how it looks: zoo_section_and_category_list in Action
Here’s the related thread which startet it all: Adaptable 2-Level Navigation-Menu with Highlighting (thanks to ruud for all comments and pointing me to helpful information)
Please feel free to comment and also criticize .. cheers, arnski
And finally here’s the included help:
Adaptable 2-Level Navigation-Menu with Highlighting
This plugin tries to accomplish the following:
- Building a 2-Level Navigation-Menue using a single TXP-tag.
- 1st Level should consist of sections, 2nd level of categories
- Keep the 2nd level adaptable, meaning it’s contents should be controllable from users without access to and knowledge of the “Presentation”-Tab in the Admin-Interface. This means by simply adding a article-category and publishing at least one article in it a user can add a “Page” to the Website.
The TXP- Tag:
<txp:zoo_section_and_category_list>
Parameters
Same as section_list but with a few more:
- showall : Can be set to either 0 or 1. With this set to 1 the 2nd Level (categories) is always shown. 0 shows 2nd Level for active section only.
- cat_active_class : Put in css-class for the active category-link
- cat_class : Put in css-class for the inactive category-links
Example Usage:
Assuming you have four Sections – “Companyportrait,Products,Partner,Products” and have published several Articles in the section “Products” – each in one of the Categories “Concept,Productcategory1 and Productcategory2”.
The following tag
<zoo_section_and_category_list wraptag=“span” active_class=“menue_links_on” class=“menue_links_off” cat_class=“cat_links_off small” cat_active_class=“cat_links_on small” include_default=“0” showall=“0” sections=“Companyportrait,Products,Partner,Contact” />
produces:
<span class=“menue_links_off”>
<a href=“http://dev.test.com/Companyportrait/”>Companyportrait</a><br />
<a class=“menue_links_on” href=“http://dev.test.com/Products/”>Products</a><br />
<a class=“cat_links_off small” href=“http://dev.test.com/Products/?c=Concept”>Concept</a><br />
<a class=“cat_links_on small” href=“http://dev.test.com/Products/?c=Productcategory1”>Productcategory1</a><br />
<a class=“cat_links_off small” href=“http://dev.test.com/Products/?c=Productcategory2”>Productcategory2</a><br />
<a href=“http://dev.test.com/Partner/”>Partner</a><br />
<a href=“http://dev.test.com/Contact/”>Contact</a>
</span>
Example CSS:
.menue_links_off, .cat_links_off{
text-decoration: none;
color: #000;
border: none;}
.menue_links_on, .cat_links_on{
text-decoration: none;
color: #A80017;
border: none;}
Last edited by arnski (2007-11-17 00:30:02)
Offline
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Also i’d like to note that i did’nt do any heavy testing, so in case any bugs or inconsistencies come up – let me know.
Offline
Re: [plugin] [ORPHAN] zoo_section_and_category_list
your plugin seems that it’ll come handy for many people here who are looking for 2 level navigation
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Online
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Thx, i hope so – at least until the TXP 4.1.x comes out with its rumoured subsection-features 8)
Offline
#5 2007-08-25 21:17:15
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Any chance of an update that produces unordered lists rather than a span with line breaks? This plugin looks handy, but I’d prefer the improved semantics and structure of a navigation list.
Offline
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Adam: No update needed – this is already built in. Like with the original versions of section_list and category_list,
you can set wraptag to “ul” / “ol” and break to “li”.
I am glad you like it.
Arne
Last edited by arnski (2007-08-26 13:51:24)
Offline
#7 2007-08-26 18:59:26
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Thanks for the clarification, Arne. I hadn’t yet had the opportunity to install this and try it out.
This just might be perfect for a site I’m currently working on, and the markup it produces is much cleaner than the alternative I was considering. Thanks!
Offline
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Download link does not work for me..
Offline
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Download link works for me (just tried).
Offline
Re: [plugin] [ORPHAN] zoo_section_and_category_list
This looks really good. Thanks!
I usually use a clean URl solution like “sgb_url_handler” or “gdp_permlinks” to do /section/category could you add a clean=“1” attribute to output category links in this format?
Oh, yeah… and how likely is it that this plugin could be adapted to work with rss_unlimited _categories?
Last edited by mrdale (2007-08-27 05:42:42)
Offline
Re: [plugin] [ORPHAN] zoo_section_and_category_list
Adam: NP. I’d be glad if someone has a use for it. If you try it out, let me know how it works for you and if you can think of any improvements.
Jstubbs: I am hosting this on a very small webhost – actually it is just some friends renting a server. It is very cheap to host (i am paying 2.50€ / Month for PHP, MySQL and everything else one could wish for (well, except rails-hosting)). On the downside sometimes it’s a little “glitchy” when someone installs something new or stuff like that happens. If you know of a more stable and free place to host this plugin (is it possible to upload it to this forum / textpattern.org?), let me know.
Ruud: Thx letting me know as i was about to contact the server admin.
Rick: Wow! Someone actually uses my plugin (well, on top of me) (^-^)
Dale: I will see to the “clean”- attribute as soon as i get some free-time from learning automata theory (with my finished diploma in “Medieninformatik” – and after 2 years of internet-freelancing – i got nothing better to do than studying again – this time “Robotik” ;) ). Provided i find a somewhat bigger pile of time i will check out the rss-unlimited-categories plugin and its changes to the TXP-database – i am sure there is a solution to that, too.
.
.
.
I must say am glad there is interest in this and let see … my automata- theory test ist on Sept 13. and after that it’s time for a v0.2. It will also include a new atrribute to switch the behaviour connected to clicking on a section:
Right now, when you click on it, it’ll show you all articles in that section. Hence, the category links work as a filter – as clicking on them will display a subset of these articles. To make it more similar to a “regular” Site-menu i want to ad the possibility to add an attribute named like “section_overview”. Setting this to 1, a click on the Section would show only one specific article acting as the mainpage (“overview”) for that section.
.
.
.
Any further suggestions are welcome and thanks so far for all the constructive feedback –
Arne
Last edited by arnski (2007-08-27 12:39:16)
Offline
#12 2007-08-27 14:23:30
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: [plugin] [ORPHAN] zoo_section_and_category_list
arnski wrote:
Adam: NP. I’d be glad if someone has a use for it. If you try it out, let me know how it works for you and if you can think of any improvements.
The only improvement I can think of is the ability to arbitrarily re-order categories. Any chance of that someday down the road?
Offline