Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2006-03-08 02:14:39
- p_see
- Member
- Registered: 2006-02-24
- Posts: 17
Re: tru_tags: A tagging plugin for textpattern
Messy URL
As I say in my first post:
This is the type of url we got :<code>http://mysite/tag?t=nikon </code>
So the tag search don’t work because the “tag section” is not called. We must have instead: <code>http://mysite/?s=tag&t=nikon</code>
This is why I have changed the 2 lines of the path url like this:
<code>$url = ‘http://’ . $siteurl . $path_from_root .’?s=’. $tagsection . ‘&t=’;</code>
would be practical to have a popup list in the advanced options with all the existing tags
I’ll bet it’s quite possible. I’m going to keep it in mind for a “version 2,”
Good!
Offline
Re: tru_tags: A tagging plugin for textpattern
truist wrote:
They do work, if you specify a wraptag and/or a break. For “class” to work, you have to specify a wraptag that is a html tag. For “breakclass” to work, you have to specify a break that is a html tag.
If you don’t specify a wraptag then there’s nowhere to put the class, and if you don’t specify the break the default break is a comma, which isn’t an html tag, and therefore can’t have an attribute.
Brilliant. I should have figured that out. Thanks!
Not sure if this was being planned, but I had the need to output a list of the tags and how many articles are associated with each tag—like a category list. I just copied and modified the tru_tags_cloud function to create a tag called “tru_tags_catlist” Here’s the modified plugin (the new function is at the bottom): tru_tags.txt
Offline
Re: tru_tags: A tagging plugin for textpattern
i have a little problem, when i click a tag, for exampel sun, you get a list with all tag with sun in the name, like sunshine, sunne and so on…
Offline
Re: tru_tags: A tagging plugin for textpattern
I’ve published a new version, with a lot of (backwards compatible) changes. They are:
- p_see – I finally got what you were talking about, and incorporated your change. tru_tags will now work on sites that are configured to use messy urls.
- gdtroiano, your change was a great idea. I incorporated it, but not by adding a whole copy of tru_tags_cloud. Instead, I’ve made a new function (tru_tags_list) that can generate any sort of list – a cloud, a bulleted list, with/without tag counts, and with/without font-size changes. tru_tags_cloud now just calls tru_tags_list with appropriate defaults. If you want to upgrade, you should just be able to switch your “tru_tags_catlist” call over to say “tru_tags_list showcounts=“true”“. There are some other fancy customization options there, if you want them :)
- As part of the rework of tru_tags_cloud, I added two new attributes: minpercent and maxpercent. These let you control the generated font-size percentages. They default to 100 and 200 (which is what they were hard-coded to before).
himynameisjonas, your problem is another side-effect of reusing the Textpattern code. It does a “like” match on the tags, which will match substrings. Sorry :-(
Finally, I’ve updated the features list to include these new features, and a list of all the issues/bugs/missing features I’m aware of. (I’ve also updated the usage instructions.)
Last edited by truist (2008-07-03 12:07:37)
Offline
#20 2006-03-10 11:06:45
- p_see
- Member
- Registered: 2006-02-24
- Posts: 17
Re: tru_tags: A tagging plugin for textpattern
Hi, I had difficulties to explain because of my poor English.
The w3.validator ask to change the <code>’&t=’</code> (in the url) to <code>’& amp;t=’</code>. (Without the space beetwen “&” and “amp;”).
You can add this small modification for next the release.
As far as I can say Tru_tag is small, easy and beautiful.
Thanks again.
Offline
Re: tru_tags: A tagging plugin for textpattern
Fixed, and posted as v1.1 (no version bump). Thanks so much for all your help!
Offline
Re: tru_tags: A tagging plugin for textpattern
I’ve published a new version…
Excellent! Thanks for this great plugin.
Now if I only knew htaccess well enough to make clean urls…
Offline
Re: tru_tags: A tagging plugin for textpattern
Awesome plugin! Do you have plans to put the rel=“tag” in the urls for Technorati?
“If you build it, they will come.”
Offline
Re: tru_tags: A tagging plugin for textpattern
Hi! Just started using the tru_tags plugin – nice one. But I can’t get the “prev.” “next” links to work when I browse the tags (like http://mysite.com/?s=tag&t=blog)
My default page look like this (just the content part):
<code>
<div id=“content”>
<txp:if_section name=“tag”>
<txp:tru_tags_handler />
<txp:else />
<txp:article />
</txp:if_section>
<txp:if_individual_article>
<p>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next>
</p>
</txp:if_individual_article>
<txp:if_article_list>
<p>
<txp:older>Previous</txp:older>
<txp:newer>Next</txp:newer>
</p>
</txp:if_article_list>
</div>
</code>
What should I do to show the “prev.” “next” links when I browse articles by tags?
Regards
Brian
Offline
Re: tru_tags: A tagging plugin for textpattern
gdtroiano, you and I are proving why pair programming is such a great thing. I hadn’t even though of using rewrite rules to make clean urls work. It’s hacky, but I got it working :)
I’ve posted a new version (v1.2), with support for clean urls (if you modify .htaccess), <code>rel=“tag”</code>, and showing tag counts in the <code>title</code> attribute. All of it is backwards compatible, and will behave like it used to if you don’t change anything.
I’ve also added a tiny bit of documentation to indicate that <code>tru_tags_handler</code> will take all the <code>tru_tags_cloud</code> attributes.
Please read the documentation about clean urls before using them. You have to modify your .htaccess file and the plugin (in one easy place) to make it work.
Download here and read the instructions here.
OIZee, the issue with the pagination is another side-effect of the <code>doArticles()</code> reuse, and there’s nothing I can do about it. It will show all the tagged articles (no matter how many!) on one page.
Offline
Re: tru_tags: A tagging plugin for textpattern
Well, that’s the problem. It doesen’t show more that the first 10. It would be fine if it just showed all of them, but it doesn’t.
I have checked again and i have 12 articles in one of my tag-categories, but only 10 are shown with “?s=tag&t=thetagname”.
Thanks for the quick reply :-)
Regards
Brian
Offline
Re: tru_tags: A tagging plugin for textpattern
is there any way to make swedish character to work in tags?
Offline
Re: tru_tags: A tagging plugin for textpattern
You’re a lifesaver. I was getting 404 errors so I had to fiddle with the .htaccess to get it working on my sever, but I finally did it.
Another question: Is it somehow possible to use an < txp:else /> statement with the tru_tags_if_tag_search tag? I ask because I would like to customize the title, but I’m already using the ob1_title plugin and I would like to continue to do so.
Thanks for all the help!
Offline
Re: tru_tags: A tagging plugin for textpattern
It doesen’t show more that the first 10
I figured out the problem. doArticles() uses a default <code>limit</code> of “10”. You can override that yourself by passing <code>limit=“1000”</code> to <code>tru_tags_handler</code>, or you can upgrade to 1.3 (see below).
Is it somehow possible to use an < txp:else /> statement with the tru_tags_if_tag_search tag?
txp:else should have been working with tru_tags_if_tag_search, all along. I did notice that txp:else support wasn’t enabled for tru_tags_if_has_tags, and fixed that (but didn’t test it). You may be running into a textpattern bug where it won’t let you use nested txp:else’s in certain circumstances (I can’t remember what they are). I ran into that problem, and it seems that the general solution is to use multiple forms to hold the if’s. That’s how I got around it on my site.
And in other news, I released a new version (v1.3) that bumps the default <code>limit</code> to 1000 when doing a tag search, fixes txp:else support with tru_tags_if_has_tags, and fixed/documented a minor bug with the section keyword and tru_tags_handler.
Offline
Re: tru_tags: A tagging plugin for textpattern
Thank you! Works fine now. Great plugin, keep up the good work :-)
Regards
Brian
Offline