Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-06-15 03:40:20

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

[Archived] stw_category_tree

ARCHIVED PLUGIN: this can be acheived with a combination of native tags
==============================

Name: stw_category_tree
Author: Sandor Weisz
Created: 2004-06-14
Modified: 2006-11-21
Version: 1.0.1
Download: stw_category_tree

<?php

$plugin='YTo4OntzOjQ6Im5hbWUiO3M6MTc6InN0d19jYXRlZ29yeV90cmVlIjtzOjc6InZlcnNpb24iO3M6NToiMS4wLjEiO3M6NjoiYXV0aG9yIjtzOjEyOiJTYW5kb3IgV2Vpc3oiO3M6MTA6ImF1dGhvcl91cmkiO3M6MjM6Imh0dHA6Ly93d3cuc2FudGhlby5jb20vIjtzOjExOiJkZXNjcmlwdGlvbiI7czoxMjk6IkRpc3BsYXlzIGxpbmtzIHRvIGNhdGVnb3JpZXMgaW4gYSBoaWVyYXJjaGljYWwgc3RydWN0dXJlLCBhbG9uZyB3aXRoIGNvbnRlbnQgY291bnQuIEluY2x1ZGVzIHNjYWRzIG9mIGhpZGluZyBhbmQgc2hvd2luZyBvcHRpb25zLiI7czo0OiJoZWxwIjtzOjg0MDY6IgoJPHA+PHN0eWxlPjxiciAvPgp0ZCB7cGFkZGluZzoycHg7fTxiciAvPgo8L3N0eWxlPjwvcD4KCgk8cD5UaGlzIHdvcmtzIGxpa2UgdGhlIGNhdGVnb3J5X2xpc3QgdGFnLCBidXQgaW5zdGVhZCBvZiBsaXN0aW5nIHRoZSBjYXRlZ29yaWVzIGxpbmVhcmx5LCBpdCBjcmVhdGVzIGEgaGllcmFyY2hpY2FsIHN0cnVjdHVyZSAoYnkgZGVmYXVsdCwgdGhyb3VnaCB1bm9yZGVyZWQgbGlzdHMpLiBJdCBhbGxvd3MgZm9yIGRlcHRoIGNvbnRyb2wsIHBydW5pbmcsIGNvbnRlbnQgY291bnQgdG90YWxzLCBhbmQgc29tZSBDU1MgcHJvcGVydGll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wdHkoJHBydW5lKSkgICAgICAgPyAgZmFsc2UgICAgICAgICA6ICAkcHJ1bmU7CgkkdHlwZSAgICAgICAgICA9ICAoZW1wdHkoJHR5cGUpKSAgICAgICAgPyAgImFydGljbGUiICAgICA6ICAkdHlwZTsKCSRjb3VudCAgICAgICAgID0gIChlbXB0eSgkY291bnQpKSAgICAgICA/ICBmYWxzZSAgICAgICAgIDogICRjb3VudDsKCSRraWxsZW1wdGllcyAgID0gIChlbXB0eSgka2lsbGVtcHRpZXMpKSA/ICBmYWxzZSAgICAgICAgIDogICRraWxsZW1wdGllczsKCSRsb2NhbGl6ZWQgICAgID0gIChlbXB0eSgkbG9jYWxpemVkKSkgICA/ICBmYWxzZSAgICAgICAgIDogICRsb2NhbGl6ZWQ7CgkkdGltZSAgICAgICAgICA9ICAoZW1wdHkoJHRpbWUpKSAgICAgICAgPyAgInBhc3QiICAgICAgICA6ICAkdGltZTsKCSRzdWJ0b3RhbCAgICAgID0gIChlbXB0eSgkc3VidG90YWwpKSAgICA/ICBmYWxzZSAgICAgICAgIDogICRzdWJ0b3RhbDsKCgkkbGFiZWwgICAgICAgICA9ICAoZW1wdHkoJGxhYmVsKSkgICAgICAgPyAgIiIgICAgICAgICAgICA6ICAkbGFiZWw7CgkkbGFiZWx0YWcgICAgICA9ICAoZW1wdHkoJGxhYmVsdGFnKSkgICAgPyAgIiIgICAgICAgICAgICA6ICAkbGFiZWx0YWc7Cgkkd3JhcHRhZyAgICAgICA9ICAoZW1wdHkoJHdyYXB0YWcpKSAgICAgPyAgInVsIiAgICAgICAgICA6ICAkd3JhcHRhZzsKCSRicmVhayAgICAgICAgID0gIChlbXB0eSgkYnJlYWspKSAgICAgICA/ICAibGkiICAgICAgICAgIDogICRicmVhazsKCglpZiAoJHN0YXJ0ID09ICIqIikgJHN0YXJ0ID0gJGMgPyAkYyA6ICJyb290IjsKCWlmICgkc3RhcnQgPT0gIipzIikgJHN0YXJ0ID0gJEdMT0JBTFNbJ3MnXTsKCWlm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saXN0KCRyb290LCAkdHlwZSkgewoJJHJvb3QgPSBkb1NsYXNoKCRyb290KTsKCglleHRyYWN0KHNhZmVfcm93KAoJCSJsZnQgYXMgbCwgcmd0IGFzIHIiLAoJCSJ0eHBfY2F0ZWdvcnkiLAoJCSJuYW1lPSckcm9vdCcgYW5kIHR5cGUgPSAnJHR5cGUnIgoJKSk7CgoJJHJpZ2h0ID0gYXJyYXkoKTsKCgkkcnMgPSBzYWZlX3Jvd3Nfc3RhcnQoCgkJIm5hbWUsIGxmdCwgcmd0LCBwYXJlbnQsIHRpdGxlIiwKCQkidHhwX2NhdGVnb3J5IiwKCQkibGZ0IGJldHdlZW4gJGwgYW5kICRyIGFuZCB0eXBlID0gJyR0eXBlJyBvcmRlciBieSBsZnQgYXNjIgoJKTsKCgl3aGlsZSAoJHJvdyA9IG5leHRSb3coJHJzKSkgewoJCWV4dHJhY3QoJHJvdyk7CgkJd2hpbGUgKGNvdW50KCRyaWdodCkgPiAwICYmICRyaWdodFtjb3VudCgkcmlnaHQpLTFdIDwgJHJndCkgewoJCQlhcnJheV9wb3AoJHJpZ2h0KTsKCQl9CgoJCSRvdXRbXSA9IGFycmF5KAoJCQknbmFtZScgPT4gJG5hbWUsCgkJCSd0aXRsZScgPT4gJHRpdGxlLAoJCQknbGV2ZWwnID0+IGNvdW50KCRyaWdodCksCgkJCSdwYXJlbnQnID0+ICRwYXJlbnQsCgkJCSdjaGlsZHJlbicgPT4gKCRyZ3QgLSAkbGZ0IC0gMSkgLyAyCgkJKTsKCgkJJHJpZ2h0W10gPSAkcmd0OwoJfQoJcmV0dXJuKCRvdXQpOwp9CiI7czozOiJtZDUiO3M6MzI6ImRiNTFlNjUyY2Q2MjcxODEwMjczZDEwN2JmYjlmODM1Ijt9'
?>

Update: Starting with version 0.7, you should be using TXP 4.0.3 or later. I haven’t tested it with any earlier version, so caveat emptor. If you’d like to use an earlier version download version 0.5 or version 0.6.1.

———

This works like the category_list tag, but instead of listing the categories linearly, it creates a hierarchical structure (by default, through unordered lists). It allows for depth control, pruning, content count totals, and some CSS properties.

NEW IN 1.0.1:
  • Supports clean category URLs as defined by the sgb_url_handler plugin, if you have that plug-in installed. Such links must be in the format of section/category (as defined by default).
NEW IN 1.0:
  • Support for wraptag and break properties.
  • The killempties property restricts the plugin to only display categories that have one more more items in them, or that have sub-categories that have one or more items in them.
  • New property: localized. Set localized to “y” to make the plugin show only categories that are part of the current section.
  • New property: time. Each category article count is now, by default, only counting articles dated in the past. Set time to “future” or “all” to alter that.
  • New property: subtotal. To make the item count show the sum of the items in the category as well as its sub-categories, set subtotal to “y”.
  • Tested in TXP v. 4.0.3.

It accepts the following attributes:

@start@ If you’d like the category tree to start at a node deeper than the root, set this attribute to the name of that cateogry. All categories underneath specified node will be displayed. If unspecified, tree starts at root. If set to *, it’ll be set to the current category. If set to *s, it’ll be set to the current <i>section</i>, in case you prefer to hack the system that way.
@maxlevel@ The deepest level you’d like displayed. If unassigned, there is no maximum.
@minlevel@ The shallowest level you’d like displayed. If unassigned, there is no minimum.
@prune@ When set to “y”, the tree will prune away any categories that are not either a) ancestors of the current category, b) the current category, c) children of the current category, or d) siblings of {a} and {b}. Is false by default.
@cat@ Works in combination with prune or onclass (below). Setting the value of this attribute to a category overrides the current category when pruning is turned on. It’ll also affect the assignment of the class=”…”, if onclass is set to something.
@section@ If you’d like all category links to go to a specific section, set this to the preferred section. If you’d like to use the current section, whatever it is, set this to “*”. If unspecified, no section will be specified. (Note that in TXP, if you require a category link to specify both a category and a section, the link will always be messy — i.e. in the format /path/to/site/SECTION/?c=CATEGORY.)
@cssid@ The value you’d like assigned to the id property of the top-level ul tag. If unassigned, the attribute is omitted.
@onclass@ The value you’d like assigned to the class property of the current cateogry and all of its ancestors. Note: if this is assigned to anything other than an empty string, id attributes will also be assigned to <i>all</i> li tags with the value set to that li’s category. If unassigned, no class or id attributes will be assigned.
@type@ Defines which type of categories to generate: ‘article’, ‘image’ or ‘link’. Is set to ‘article’ by default.
@count@ When set to “y”, each category link will be followed by the number of live items within that category, set inside parentheses. If you’d like the number to be set inside a different pair of characters, set count to those characters. For example, to make it output “CategoryName {3}”, set count to “{}”. Is false by default. New in version 0.6: If you’d like the count to appear only when it’s greater than 0, set the third character of the attribute to ‘!’. For example, “{}!” will appent “ {#}” to the end of the category name only with that category has one or more items in it.
@killempties@ (Changed in 1.0) When set to “y”, it will restrict the plugin to only display categories that have one more more items in them, or that have sub-categories that have one or more items in them.
@localized@ (New in 1.0) When set to “y”, it will restrict the plugin to only display categories the plugin show only categories that are part of the current section.
@time@ (New in 1.0) The article count now only includes articles written in the past. To include future categories, set this property to “all”. To show only future categories, set this property to “future”.
@subtotal@ (New in 1.0) When set to “y”, each category’s item count will be th sum of the items within itself plus the number within all its sub-categories.
@label@, labeltag Works like all other TXP tags. When at least the former is set, prefixes your output with a line of the format <labeltag>label</labeltag>.
@wraptag@, break (New in 1.0) Works like all other TXP tags. Wraps each category link in the break tag, and wraps each level of breaks with the wraptag. If break is set to “hr” or “br”, it’ll append the tag to the end of the link instead of surround it. Set either to a space (” “) to use remove the tag. Is set to “ul” and “li” by default.

Try it out and see. Best understood by trial and error. Please report any hinkiness by posting in the TXP forum.

(Note: I had to create some adjunct functions to work with this tag, so while I haven’t included documenation for stw_get_lineage and stw_get_parent [and others], they’re there and free to be played with. Noodle around and try them out, if you’d like.)

———

Thanks to Pin007 for his implementation of the type property.
Thanks to Tinyfly for the assistance in making stw_get_live_count work with links and images.

Last edited by santheo (2006-11-21 17:04:13)

Offline

#2 2004-06-15 03:47:43

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

Re: [Archived] stw_category_tree

Meant to say: this plugin was inspired by Dean’s Article by Category plugin and would not exist but for the slick code I copped from within that plugin. Which code made understanding the architecture of TXP so much easier.

Offline

#3 2004-06-15 04:19:26

schussat
Plugin Author
Registered: 2004-02-24
Posts: 101
Website

Re: [Archived] stw_category_tree

Great plugin, santheo. Seems to work really nicely.


-Alan

Offline

#4 2004-06-15 13:35:42

Benoit
Member
From: Montreal, QC
Registered: 2004-05-23
Posts: 26
Website

Re: [Archived] stw_category_tree

Love the plugin, it does exactly what I want, with one exception: I would use it twice on the same page, to list two different set of sub-categories, but it only displays the first instance.

Any idea if it is possible to use in that way, and how?

Offline

#5 2004-06-15 14:17:31

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

Re: [Archived] stw_category_tree

Love the plugin, it does exactly what I want, with one exception: I would use it twice on the same page, to list two different set of sub-categories, but it only displays the first instance.

I’ve tested this situation out on my install, and it seems to work fine. My only guess at this point is that you’re misspelling the name of the category you’re putting in the start attribute.

Can you post or email me the tags you’re using, and, if possible, your category tree? That’ll make it easier to debug.

Offline

#6 2004-06-15 15:00:03

Benoit
Member
From: Montreal, QC
Registered: 2004-05-23
Posts: 26
Website

Re: [Archived] stw_category_tree

The tags I am using are:

txp:stw_category_tree start=“English” prune=“true”

and

txp:stw_category_tree start=“Fran

Offline

#7 2004-06-15 15:42:17

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

Re: [Archived] stw_category_tree

Figured it out. It wasn’t the

Last edited by santheo (2004-06-15 15:44:29)

Offline

#8 2004-06-15 17:06:13

Benoit
Member
From: Montreal, QC
Registered: 2004-05-23
Posts: 26
Website

Re: [Archived] stw_category_tree

Tried a number of combination, including the one I’d mentioned above, and still get the same problem.

If you go check http://blog-cafe.com (don’t mind the mess, it’s very much under construction), you’ll see what gets output when using the tag

txp:stw_category_tree start=

Last edited by Benoit (2004-06-15 17:49:56)

Offline

#9 2004-06-15 18:16:29

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

Re: [Archived] stw_category_tree

Benoit-

From looking at your source code, I can actually see the TXP tag, which means it’s not being picked up by the TXP interpreter. Not sure how that happened, but you’ll need to fix that first.

One suggestion: add a trailing slash to the tag. So instead of this:
<code><txp:stw_category_tree start=

Offline

#10 2004-06-15 18:22:44

Benoit
Member
From: Montreal, QC
Registered: 2004-05-23
Posts: 26
Website

Re: [Archived] stw_category_tree

OK. I’ll try that. And I’ll do some additional checking on the CSS side. Got a feeling that may be part of the problem too. Have to get back to work now, but will get back to you with what I find. Thanks again for all the help!

Offline

#11 2004-06-16 14:09:32

Benoit
Member
From: Montreal, QC
Registered: 2004-05-23
Posts: 26
Website

Re: [Archived] stw_category_tree

OK, problem fixed. :)

Using ONE instance of the plugin without trailing slash works fine, but with two instances of the plugin on the same page, it required the trailing slash for both of them to show up.

Many many thanks for all your help, Santheo, and thanks again for the great plugin!

Offline

#12 2004-06-17 06:58:40

Damelon
Member
From: Lyon, France
Registered: 2004-05-11
Posts: 47
Website

Re: [Archived] stw_category_tree

Santheo, Beno

Offline

Board footer

Powered by FluxBB