Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#109 2005-09-11 23:51:26

santheo
Archived Plugin Author
From: Chicago
Registered: 2004-05-27
Posts: 62
Website

Re: [Archived] stw_category_tree

Garfield: My assumptions about the way most people would use this plug-in lead me to decide the outputted category list would appear only once per page. Considering that, and the rules of CSS, an ID — which is meant to indentify page-unique items — seemed the more appropriate property to use. However, even if you use the tag twice on a page, you shouldn’t encounter an problems. Since the top-level ID is user-defined, you can just use a different ID for each list, and then apply the same CSS rules to both IDs.

Zanza & Alexandra- I’ll take a look at those bugs sometime in the next few weeks and get back to you. Thanks for letting me know.

Offline

#110 2005-09-12 07:48:15

Garfield
Member
From: Barcelona
Registered: 2005-07-09
Posts: 11
Website

Re: [Archived] stw_category_tree

Yes, you are right, thanks for the clue.

Now is just a matter of consistency with other TXP lists, I have touched your code in order to add the two parameters ID and CLASS:

WAS:
<code> if ($out) return tag(“\n” . $out,‘ul’,($css_id ? ‘ id=”’.$css_id.’”’ : “”)).”\n”;

IS:
<code> if ($out) return tag(“\n” . $out,‘ul’,($css_id ? ‘ id=”’.$css_id.’” class=”’.$css_id.’”’ : “”)).”\n”;

I think that it works fine, may be you could add it to the next patch… :P

Offline

#111 2005-09-12 13:16:06

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [Archived] stw_category_tree

Why would you want the $css_id as the id and the class?

Offline

#112 2005-09-12 14:11:28

santheo
Archived Plugin Author
From: Chicago
Registered: 2004-05-27
Posts: 62
Website

Re: [Archived] stw_category_tree

Garfield- I’m not sure why you’d want css_id to stand in as the ID and the CLASS. It’s up to you, of course, if you’d like to use CLASSes instead, you might consider removing the ID.

This consistency within TXP you speak of is trumped by the need for consistency within CSS. Other TXP lists are meant to be used within the page, more than once if need be. The category_tree list is meant to be shown once, and for one-time objects, an ID is the right identifier to use.

Best,
-S

PS. You might want to go back into your last message and add the missing [/code] tag.

Offline

#113 2005-09-12 14:17:41

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [Archived] stw_category_tree

Santheo – Why limit how people want to markup their list? I think it is much more flexible to be able to assign an ID, Class or both to any element. This goes not just for your great plugin but for all of txp tags.

In the case of lists, of coarse, the li or dd tag wouldn’t have an ID, that would go against the CSS rules of unique IDs on a page.

Offline

#114 2005-09-12 14:35:19

santheo
Archived Plugin Author
From: Chicago
Registered: 2004-05-27
Posts: 62
Website

Re: [Archived] stw_category_tree

Jeff-

There needs to be a balance between addressing all users concerns, and keeping the plug-in — and its features — manageable. Right now you can only assign an ID because I thought that’d be more useful than a CLASS, and I didn’t want to clutter the documentation (and code) more than it was with extraneous features. However, I’m willing to add the feature later if more people think it’s necessary. If I hear more support for this feature on this forum, I’ll consider it.

Meanwhile, anyone who needs to is free to alter the plug-in code themselves in the way that Garfield has. You could even just change “id=” to “class=” and you’d be set.

Thanks to everyone for the feedback. I’m glad to see so many are getting good use out of this plug-in.

Offline

#115 2005-09-12 14:41:59

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [Archived] stw_category_tree

Point taken. Thanks again for the plugin

Offline

#116 2005-09-20 16:27:16

trailgirl
Member
Registered: 2004-06-04
Posts: 68
Website

Re: [Archived] stw_category_tree

Will the killempties attribute suppress listing categories that do not have articles assigned to them? I’m trying it out but can’t get it to do this so I’m wondering if I’m misunderstanding the killempties purpose. I am using txp4.0.1 with stw_category_tree version 0.6.1.

Offline

#117 2005-09-24 23:25:05

flowmom
Member
Registered: 2005-08-23
Posts: 15
Website

Re: [Archived] stw_category_tree

trailgirl wrote:

Will the killempties attribute suppress listing categories that do not have articles assigned to them? I’m trying it out but can’t get it to do this so I’m wondering if I’m misunderstanding the killempties purpose. I am using txp4.0.1 with stw_category_tree version 0.6.1.

I have the same set-up as you and the killempties attribute is working fine for me. Here’s the code that I am using:
<code><txp:stw_category_tree cssid=“navigation” prune=“true” killempties=“true” onclass=”“ /></code>

Remember that the plugin documentation states:

because of the nested nature of this plugin’s output, if this attribute is set to true, it will only kill empty categories that have no children

- I take that to mean that if you have subcategories defined for a category, the listing of that category cannot be suppressed by killempties.

Good luck, this is a great plugin!


new to TXP, CMS, CSS, PHP

Offline

#118 2005-09-26 17:48:15

flowmom
Member
Registered: 2005-08-23
Posts: 15
Website

Re: [Archived] stw_category_tree

saintanodos wrote:

I notice that with TXP 4.0.1, with using stw_category_tree, I can’t mix and match clean urls and messy. Most of my site is based on clean url’s, with the format of “section/id/title”, but it seems that stw_category_tree is only based on the “?c=xxxx” format.

Yes, stw_category_tree does create messy category urls, even if you have clean urls set up. If you wade through this thread you’ll find that a guy managed to do a workaround to clean up the urls a bit, but I have no clue how to go about doing that. I would love to see clean category urls for this plugin too ;-)


new to TXP, CMS, CSS, PHP

Offline

#119 2005-09-26 21:10:13

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [Archived] stw_category_tree

You can get some of this functionality right out of the box with 4+ versions see the blog. Not all but some of the same behavior with section sensitivity. If you are concerned about urls it may be a sort of solution, depending on how deep your needs go.

Last edited by soulship (2005-09-26 21:12:02)

Offline

Board footer

Powered by FluxBB