Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [Archived] stw_category_tree
Martagnan wrote:
Currently when I select the “Air Filters” parent category I get a whole list of ALL articles in ALL it’s child categories. I would only like to see an article list once I have selected a child category, then I would see articles belonging only to that child.
Yeah, that’s beyond the abilities of the stw_category_tree plug-in. You’re going to need a plug-in that handles article output. I use chh_article_custom, though I don’t know if it supports what you want to do.
Etz Haim wrote:
The only thing I wish it had is the ability to display section and category titles instead of their names. Can you do it please?
I’m not sure what you mean by category titles. Which column in the DB table are you referring to? (I’m only on release g1.19, so if this is more recent improvement to the system, please let me know.)
Offline
Re: [Archived] stw_category_tree
Yes, this is a new TXP feature. The database has been expanded so that every category and section, apart from its name, has also a user-friendly “title”. Currently, the TXP core cannot make use of these extra fields, but the upm_section_title, upm_category_title and my own etz_crumbs plugin can take advantage of them.
This is very useful for internationalization, especially in languages that use their own alphabet (non-ASCII). See a demonstration of etz_crumbs, where in the breadcrumbs menu the category and section names are translated to Greek, thus avoiding the use of Greek characters in the URLs.
Last edited by Etz Haim (2006-11-16 17:52:52)
VC3 :: weblog :: my wishlist
Offline
Re: [Archived] stw_category_tree
Gotcha. I’ll look into it.
Offline
Re: [Archived] stw_category_tree
> kemie wrote:
> A little bump to ask if it is possible to get this working with clean urls, so my outputted list will point to /section/category instead of section/?c=category
Try editing the plugin by replacing the function stw_cat_link with this:
<code>
function stw_cat_link ($cat,$sec) {
global $pfr,$url_mode;
$path = $pfr.”?”;
if (!empty($sec) && $sec != ‘default’)
$path = ($url_mode==1) ? $pfr.$sec.”/” : $path.“s=”.$sec.”&”;
return tag($cat,‘a’,’ href=”’.$path.urlencode($cat).’”’);
}
</code>
I’m not sure if this is the right way to go about it, but it appears to be working for me.
Offline
Re: [Archived] stw_category_tree
Any news on using category titles instead of names
Refresh Dallas and other Refreshing Cities.
Offline
Re: [Archived] stw_category_tree
I have txp installed in a subdirectory called main
so its:
http://cepa/main/
When I use section=“links” on your plugin clicking a category link should take me to:
http://cepa/main/links/?c=whatever-category
Instead it takes me to:
http://cepa/links/?c=whatever-category notice the missing /main/
Any ideas on how to fix this?
Update: If I add section=“main/links” it works but main isn’t a section it is the install path of txp so it should be unnecesary.
Last edited by tinyfly (2005-05-25 21:26:41)
Refresh Dallas and other Refreshing Cities.
Offline
Re: [Archived] stw_category_tree
> tinyfly wrote:
> Any news on using category titles instead of names
There you go: admin >> plugins >> stw_category_tree >> edit
and replace:
<pre>return tag($cat,’a’,’ href=Last edited by Etz Haim (2005-05-26 01:27:18)
VC3 :: weblog :: my wishlist
Offline
Re: [Archived] stw_category_tree
Thanks Etz! That was driving me nuts (and preventing an upgrade from rev326 for a site).
Offline
Re: [Archived] stw_category_tree
Thanks Etz, does this also work for link categories?
I guess I should try it huh?
Refresh Dallas and other Refreshing Cities.
Offline
Re: [Archived] stw_category_tree
You can actually use rss_superarchive very nicely for palin ol’ cat links with section pruning . Look at this thread
Last edited by soulship (2005-06-29 19:12:36)
Offline
Re: [Archived] stw_category_tree
Why is the upm_category_title plugin needed if all categories have titles anyway?
Refresh Dallas and other Refreshing Cities.
Offline
Re: [Archived] stw_category_tree
Etz,
You are awesome, it worked perfectly. Now one more request. Can you get mem_glinklist to output category titles instead of names, as well?
Refresh Dallas and other Refreshing Cities.
Offline
Re: [Archived] stw_category_tree
I am having a problem with outputing the count number. It always shows (0) as the count no matter how many links I have. Here is how I am using the tag:
<code><txp:stw_category_tree prune=“true” type=“link” count=“true” start=”*” /></code>
Would it have anything to do with being of the “link” type?
Also, a feature request. 1.) I would like is to be able to only list categories that have content in them. 2.)I would like to be able to have the count show the number of the content in the category and all sub-categories. (for link categories in this instance)
Thanks for all your help. I love this plugin and I would be lost without it.
Update: the problem with the count is with the type being set to something other than “article” it can be fixed with my hack, replace the last function “stw_get_live_count” with the following code:
<pre><code>
function stw_get_live_count ($cat) {
if ($type=“link”) {
$q = safe_count(“txp_link”,“category=’”.$cat.”’”);
} else if ($type=“image”) {
$q = safe_count(“txp_image”,“category=’”.$cat.”’”);
} else {
$q = safe_count(“textpattern”,”(category1=’”.$cat.”’ OR category2=’”.$cat.”’) AND status=‘4’”);
}
return $q;
}
</code></pre>
I believe I have also found a bug: While using sort=”*” everything works fine if I am in a category but if I am on my section list page /links/ with no category instead of just showing all the categories in a list I recieve the following error and no categories show up at all.
<code>Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in D:\dev\sites\cepa\public_html\textpattern\lib\txplib_db.php on line 209</code>
I don’t know how to fix it.
Last edited by tinyfly (2005-05-27 21:48:11)
Refresh Dallas and other Refreshing Cities.
Offline
Re: [Archived] stw_category_tree
I would like it if the count could also include all links/articles/images in subcategories as well. Is this possible?
Last edited by tinyfly (2005-06-02 19:33:12)
Refresh Dallas and other Refreshing Cities.
Offline
Re: [Archived] stw_category_tree
(bump) Any chance on getting the top level categories to show the count for links in subcategories and showing only the categories which have content in them. Right now it will show all categories no matter if they have content or not.
Last edited by tinyfly (2005-06-17 18:36:02)
Refresh Dallas and other Refreshing Cities.
Offline