Content last modified Wednesday 27 August 2014
hop to #bottom
Categories:
Author:
About It:
Rate it:
  • Helpful?
  • 11 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

tru_tags

An advanced (but easy to use) tagging plugin, originally based on ran_tags, but with many improvements, bugfixes, and security enhancements. It has the usual tagging features (listing tags for an article, tag clouds, listing articles for a tag), and it allows you to use standard Textpattern conventions like wraptag / break / class. It is smart about future-dated and “draft” articles, and doesn’t show tags from them. It has clean URL support without modifying .htaccess. It includes tags in RSS / Atom feeds. It shows tags on the admin-side when writing/editing articles. It has admin-side tag maintenance and redirection features.

There are five pages about the plugin on my website:

You can also find source and documentation for the plugin at:

Article Request Count:
Keywords/tags:
Initially released:
2006-03-05
Posted here:
05 Mar 2006
Article modified:
26 Feb 2009

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (19)

Sweet! I’m loving the clean URLs support (though it wasn’t really a part of the actual plugin) – something to set it apart from ran_tags (or whatever that was).

is there a way that i only display top X tag words ( not posts ).. for example i don’t need all tags to be shown in the frontpage so i only make a block and put 20 top tags with a link to all tags page ?

The only similar thing is “mintagcount” (described in the instructions), but it’s not exactly what you’re asking for. You could then manually link to the default tag cloud (usually found at /tag/) or create another one somewhere.

How much do you need this feature? It’s doable, if you need it.

Nathan , thanks for answer but using mintagcount and maxtagcount will not make the results fixed .. i need to display only 20 or 30 tags at max .. even if they are all at the same degree (have the same count value) and also even if there are tags with the same degree not shown..
sorry if this will make you play more with code :)
and sorry for my bad english as well ….

I can do it, but I need to sort out one issue first. Imagine that you have 100 things in your cloud, but you only want 20 of them to show up. Also imagine that every tag was used exactly twice. How do you decide which 20 tags to show?

i think make a choose from randomize or alphabet order (don’t know if it is possible or not) cause your condition will not make any option other than that .. if it hard tell me and i will think again ..
thanks alot

That’s what I’m worried about – there’s no good way to decide which tags to show.

What if it worked where tru_tags just showed the largest set of tags that could comfortably fit under the limit you specify? So if you had the following tag usage:

cats [3]
dogs [4]
bats [3]
rats [2]
pigs [2]

...and you specified a limit of 4 tags in your cloud, tru_tags would show:

bats, cats, dogs

...because those have the most uses. It wouldn’t show ‘rats’ or ‘pigs’ because they both wouldn’t fit into the limit you specified.

I think that’s how I’d want such a feature to work – would that work for you?

I’ve a clue ..
what if you use the sort = “count” then when showing up the cloud you use for condition with the limit value and by this you will show only the top tags by sort .. and if you didn’t use sort it will be ordered alphabetically so with the same for condition and the limit value will display the tags limited to the limits value and with the alphabet order ..

i think it will ignore the usage of tag if you use alphabetical order and it will ignore some tags (if there is with the same usage) but it will be ok cause the link of tags will display all ..

using of mincount and maxcount with the alphapet order or sort order will make it run as you want as i think ..

the point here is only do the limit condition at the last level when showing up the cloud and it will still choose able to user to use it or not

sorry but i have another thing .. when i have a tag label numbers ( 2006 ) for example and showcounts=“1” sort=“count”

it dosen’t display the counts for it ..

On your comments about sorting – when you use the sort=“count” attribute, tru_tags still sorts alphabetically for each count-level. (So all the tags with a count of ‘4’ are sorted alphabetically, for example.) In that case, you’d just end up losing tags that were late in the series, but I suppose that’s ok.

I can’t see the value of using sort=“alpha” with this, though. You’d just have an essentially random set of tags showing. (i.e. those that are early in the alphabet)

I think I can implement the cut-off rule to work both ways – I just need a second attribute that says how the limiting should behave. Default is to just cut it off right at the last tag that fits, but you can switch it to behave the way I want it to.

I’ll get working on it :)

With the showcounts=“1” sort=“count” thing – I’m not sure I understand the issue. Are you saying that it doesn’t work if you have a tag like ‘2006’?

If that’s not the problem, can you paste your actual tag code here?

oh , with the sorting option .. i thought that you sort by alphabet or by counts and switching on them by using the sort or not .. i didn’t mean to use sort=“alpha” at all ..

if you can do a count-level so why you don’t just get the total of tags to see if it is longer than the limit value . if it is , you can randomizes the latest count-level and do a subtract of other count-levels to see how much you need from the last one then do for loop with the result so the option will be with the last count-level of the groups ..

and to the other issue .. yes it is the problem if i have a tag 2006 or 1427 it will not show the counts nor define it in right place (if it has 4 counts it will display it as 1 counts) ..

btw: if you have an IM client and want to do it easier by chating please tell me yours ..

thanks alot

To limit the number of tags shown, you could perhaps sort on rand(0,tag_count), where tag_count is the number of times each tag occurs. This still gives all tags a chance to appear, but prefers the tags with higher counts.

jadelrab / Rudd – this feature has been implemented with the ‘listlimit’ attribute (and a few others) in tru_tags 2.0. Happy new year!

Wow ! what a great surprise ..

thanks alot nathan ..

happy new year to you too :)

since nathan sold the url truist.com he and all the documentation is now available here

fantasmo:

Hello, i didn’t really get that how to put the tag search term into the tag results.
I want to click on a tag in the tag cloud and then displaying something like “For the tag XYZ existing following articles”

I typed this:
<txp:if_section name=“tag”> <h2>For the tag <strong><txp:search_term /></strong>exist following articles</h2> <txp:tru_tags_handler form=“tag_results” />
<txp:else /> <txp:article />
</txp:if_section>

But that doesn’t output the searched tag.

What do I need to write instead?

Instead of <txp:search_term /> you should use tag:

<txp:tru_tags_tag_parameter striphyphens=“1” />

(That striphyphens is not required, but it makes tag look a bit nicer.)

fantasmo:

@Petri Oh great, thank you:-)!
(I already tried tru_tags_search_parameter which is deprecated…the tag you mention should be included into the tag reference. I couldn’t find it there)

fantasmo:

oops, it’s already there…just delete my last comment;-)

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment or visit the forum discussion?

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.