Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2007-03-27 11:32:16
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: couple of suggestions on categories
nice! Thanks Mary
Offline
#14 2007-03-28 14:34:55
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: couple of suggestions on categories
Oh, something else that awes me as much in its, er, stupidity : when using both <txp:category>
and <txp:section>
as container tags (for links) whilst specifying a class attribute, it is simply not used. Promised, I’ll learn how to submit patches. In the mean time, here’s the corrected code:
<txp:section>
if ($thing)
{
$out = '<a href="'.pagelinkurl(array('s' => $sec)).'"'.
($title ? ' title="'.$label.'"' : '').($class ? ' class="'.$class.'"' : '').
'>'.parse($thing).'</a>';
}
<txp:category>
if ($thing)
{
$out = '<a href="'.pagelinkurl(array('s' => $section, 'c' => $category,)).'"'.
($title ? ' title="'.$label.'"' : '').($class ? ' class="'.$class.'"' : '').
'>'.parse($thing).'</a>';
}
I can only hope this will be corrected as rapidly.
Last edited by guiguibonbon (2007-03-28 14:35:24)
Offline
Re: couple of suggestions on categories
guiguibonbon wrote:
when using both
<txp:category>
and<txp:section>
as container tags (for links) whilst specifying a class attribute, it is simply not used.
Can those tags be used as container tags?
I didn’t know that!
I remember I have asked for that feature a year ago, but I didn’t know it was implemented.
Do you mean you something like this can be done?
<txp:section name="blog" link=1>check my blog</txp:section>
That would be cool.
Offline
#16 2007-03-28 15:19:43
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: couple of suggestions on categories
yeah, absolutely. And link="1"
is mandatory. He understands it’s a link you want as soon as you use it as a container tag.
EDIT: oops, I meant is not mandatory, of course.
Last edited by guiguibonbon (2007-04-02 09:36:45)
Offline
#17 2007-03-30 13:10:36
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: couple of suggestions on categories
In the mean time, here’s the corrected code…
Thanks for pointing that out. I’ll commit a patch for section, category, category1 and category2 shortly.
Promised, I’ll learn how to submit patches.
It’s really easy, particularly if you use a GUI, such as TortoiseSVN.
Offline
#18 2007-04-01 15:50:29
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: couple of suggestions on categories
Thanks again Mary (r2264).
Problem with svn is I tend to hack a lot, which would, if i get the system right, bring alot of spam in with the patch.
Last edited by guiguibonbon (2007-04-01 15:50:50)
Offline
Re: couple of suggestions on categories
guiguibonbon wrote:
- an option should be set to treat articles whose categories have a parent category as if they were in that category (e.g. on the parent’s category listpage, articles with any of the child categories should also be displayed). The basic functions have already been written by Coke Harrington (chh_category_sql function in his article library)
I second this option, as I’d like to have it implemented when using a related_article list. At the moment, the related_article looks only for exact category, but I feel it should be take into account also the parent cat, even if with a minor weight than exact match, I suppose.
Any thought on this? Does it make sense?
Thank
Z-
Offline
#20 2007-04-02 09:30:12
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: couple of suggestions on categories
Z, I totally agree. Of course, all the chh plugins do no less than that already. The problem being, these plugins work very badly in conjunction with MLP pack, as well, presumably, as with other plugins.
I guess that if we want this to be added to svn, instead of waiting for any big next release (which might take years), we’ll have to find a tag-syntax that’s backwards-compatible, e.g. that doesn’t brake sites that were built with the all those tags not taking into account parent categories.
Last edited by guiguibonbon (2007-04-02 09:32:50)
Offline
Re: couple of suggestions on categories
I have some minor suggestions for the categories, which are currently available through plugins, but i don’t understand, why these are not part of the core code:
1. txp:article_custom features from chh_article_custom
Could the article_custom tag be extended to allow in the parameter categories a list of categories instead of one category?
When displaying a parent category in a hierarchical category structure, it might be useful to allow for a “children” parameter, which displays all articles in the children categories.
What about displaying all categories except for one or two? There a exclude-parameter would be useful.
The issue with this features is, the chh_article_customs seems to be without maintainer. Currently, useres get some errors in debug-mode, and probably it could break in the future, but the plugin provides a lot of useful features, i’d rather have in the core than in this plugin.
2. txp:category_list features from e.g. cbs_category_list
I like this tag, but I miss a show count option which shows the number of articles published in the category, as we can see it currently in the admin-category-panel
Offline
Re: couple of suggestions on categories
txp:article_custom features from chh_article_custom
I second that, particularly given that chh_article_custom duplicates a lot of the existing txp code.
Yes, the ability to insert comma-separated lists of sections or categories would be great. Also the ability to search all sections excluding only some, for instance through an extra exclude
attribute or a "!section-name"
in the sections list would be great. This last I have hacked into chh_article_custom for one site.
Last edited by jakob (2007-06-22 09:06:58)
TXP Builders – finely-crafted code, design and txp
Offline
Re: couple of suggestions on categories
I like the "!section-name"
solution, because it works well in tags like article_custom where you can specify both category and section in the attributes. And since there are already places where the section attribute accepts a comma separated list, it would be convenient to allow that everywhere.
Offline
Re: couple of suggestions on categories
Ruud, that’s great to hear :-)
Every time I use chh_article_custom I feel like I’m cheating because in essence it’s not far removed from the txp-own function.
TXP Builders – finely-crafted code, design and txp
Offline