Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#721 2011-08-12 15:50:23
Re: tru_tags: A tagging plugin for textpattern
Okay, I’m an idiot after all.
In the third snippet above, I see I used listform="blog_titles"
when it should have been listform="blog-titles"
. It helps to have the form names correct. :/
So everything seems to work okay.
Feel free to use those snippets as examples in your docs. :)
Offline
#722 2011-08-16 10:48:23
Re: tru_tags: A tagging plugin for textpattern
Hi,
Apologies if this has already been brought up in this mammoth thread, as I haven’t had the time to read through it.
I’ve been implementing tru_tags into my site and ran into a bit of a problem with tags that contain spaces as well as hyphens. eg when you browse to the tag ‘this is-a-tag’ I get a 404 error. The url for the page is http://example.com/tag/this-is-a-tag/
I dug through the code and found that by modifying this line
function tru_tags_handler($atts) {
$tag_parameter = tru_tags_tag_parameter(array(), false);
to this
function tru_tags_handler($atts) {
$tag_parameter = tru_tags_tag_parameter(array('striphyphens' => 'lookup'), false);
It works and I don’t get a 404 error. I also didn’t see any other adverse affects.
However, when I then looked at the Google code page for the plugin I noticed a fix had been implemented for this same issue but uses a different approach which requires the tags to be re-created. The r27 fix changes the urls to http://example.com/tag/this+is-a-tag/ whereas the change I made above allows you to keep the existing http://example.com/tag/this-is-a-tag/
Is there something potentially wrong with my implementation that I’ve missed? It seems to work. And should I revert and use the fix implemented in r27?
Offline
#723 2011-08-16 14:48:21
Re: tru_tags: A tagging plugin for textpattern
sbarakat I remember the issue but let’s wait for the other gods of code, esp. Nathan, to audit your solution :)
truist Nathan, what’s your comment on those two solutions?
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#724 2011-08-16 19:05:40
Re: tru_tags: A tagging plugin for textpattern
sbarakat,
I’m on vacation at the moment so I haven’t taken the time to dig through the code, but it’s quite likely that what you say is correct. My original fix for this issue was meant to be strictly backwards-compatible, and as such was somewhat sub-optimal for new users. I don’t remember the details of exactly how it was backwards-compatible and/or sub-optimal, though.
Perhaps a middle-of-the-road solution would be to modify your changes, such that the ‘atts’ array would be passed in to tru_tags_tag_parameter, thereby allowing the user (in the TXP admin) to just pass “striphyphens=lookup” as an attribute of their ‘tru_tags_handler’ call. I’m not 100% sure that would work, but something like it should solve the problem for everybody.
Note that the ‘lookup’ feature comes with a mild performance penalty, also, because of the extra lookup(s).
Offline
#725 2011-08-17 08:36:26
Re: tru_tags: A tagging plugin for textpattern
Hi truist,
Thanks for taking the time to get back to me. There’s no rush, enjoy your vacation :)
Your suggestion of adding the striphyphens attribute to the tru_tags_handler is a nice alternative. I will keep my changes in place until the next release, if I notice any issues in the meantime I will report back here.
Offline
#726 2011-09-15 08:31:14
Re: tru_tags: A tagging plugin for textpattern
hi
i do have a question, that i do carry around for a while now:
why is it, that the tags get transformed (talking about texttransform)?
why cant i get the tags out of the database, like i typed them in..? because in some cases the transformation is fugly.
or am i missing a setting, that allows just that?
Offline
#727 2011-09-15 13:20:50
Re: tru_tags: A tagging plugin for textpattern
jens31 – I implemented it this way a long time ago, just to make sure that if the user typed their tags in different cases each time, tru_tags would still recognize them as the same tag. It would be possible to add a new transformation like “original”, but it would take a bit of work. Looking at the code, I noticed that there’s also an Admin setting (TXP Admin -> Extensions -> tru_tags) called “Convert tags to lowercase by default” that you could try turning off, to see if that does what you want.
Offline
#728 2011-09-15 13:30:36
Re: tru_tags: A tagging plugin for textpattern
niiiice. was still working with an old version, so i missed that setting.
thanks for looking after this..
Offline
#729 2011-10-23 11:33:40
Re: tru_tags: A tagging plugin for textpattern
I have two questions:
- Before the latest TXP Upgrade, the tag box in the write tab would have a fixed size and could be scrolled. Now, I have a huge list of all the tags. Can I get the fixed-size box back somehow?
- In the settings, it says autocomplete is possible with a jQuery plugin. That plugin is deprecated – what’s the best solution to get autocomplete for typed tags?
Thanks in advance.
Offline
#730 2011-10-23 19:52:00
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: tru_tags: A tagging plugin for textpattern
andreas wrote:
the tag box in the write tab would have a fixed size and could be scrolled.
Really? I’ve never seen that. If it can behave like that I’d love to know how!
Offline
#731 2011-10-24 18:42:34
Re: tru_tags: A tagging plugin for textpattern
I just realized that this wasn’t a feature of the plugin itself but that I made it using a plugin called hpw_admincss.
With that, you can style elements of the admin interface. You create a style named “admin” and if you add the following CSS, the tag box will look just like a normal textarea and will scroll.
.tru_tags_admin_tags {
display: block;
height: 250px; /* set this to whatever you want */
overflow: auto; /* this will cause a scrollbar to appear */
padding:3px;
margin: 5px 0;
background: #E9E9E9;
border: 1px solid #ccc;
border-color: #878787 #fff #fff #878787;
}
Last edited by andreas (2011-10-24 18:43:02)
Offline
#732 2011-10-24 20:00:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: tru_tags: A tagging plugin for textpattern
andreas wrote:
With that, you can style elements of the admin interface. You create a style named “admin” and if you add the following CSS, the tag box will look just like a normal textarea and will scroll.
Thank you! But if it doesn’t work anymore for you, it looks like the plugin is not ready for the latest Txp?
Offline