Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#277 2007-05-12 06:55:02
- John Wozniak
- Member
- Registered: 2006-10-20
- Posts: 37
Re: tru_tags: A tagging plugin for textpattern
I am trying to wrap up this site within the next week or so and I have a few nagging issues with functionality I would like to address.
I am not sure why, but the tag cloud does not link to the story as it should.
It’s been a long day – what am I missing/how can I fix this?
Also, what can I do to exclude the static pages from being shown in the recent articles list (they will get buried soon but I would still like to know how to do it – they were created by following the FAQ and have a status of “live” so they are searchable – I imagine this is why they in the recent articles list)?
I appreciate any help a lot.
(Please ignore the things I haven’t yet gotten to styling and the slightly messy markup)
Offline
#278 2007-05-12 10:26:32
Re: tru_tags: A tagging plugin for textpattern
@John: Unspoken questions are answered immediately. Miracles will take a little longer :-)
Pls. give code examples or link to a page with a list of code examples.
a) The tag cloud does not link to articles but to tag search result pages.
b) On tag search result pages you must have a form to present full articles or excerpts (as you like it). (Edit: Use tru_tags_if_tag_search parameter to get the big cloud or tag search result output/list.)
Edit: Single Tags are comma separated in the keyword field!
Basic code logic on the tag page template goes like this:
<txp:output_form form="header" />
<txp:if_section name="tag"><!-- optional -->
<txp:tru_tags_if_tag_search><!-- important -->
<!-- Consider using txp:output_form form="tag_search_result"
for complex pages like http://sankt-georg.info/tag/video/
Rule: Always use (nested) forms to keep page templates maintainable ! -->
<h3>Tag search result for: <txp:tru_tags_tag_parameter striphyphens="1" /></h3><!-- example -->
<txp:tru_tags_handler form="tagpost" sort="Posted desc" limit="100" />
<txp:else /><!-- important -->
<h3>My tag cloud</h3><!-- example -->
<txp:tru_tags_cloud usereltag="1" showcounts="title" minpercent="80" maxpercent=200" />
</txp:tru_tags_if_tag_search><!-- important -->
<txp:else />
<!-- nothing here = return/exit -->
</txp:if_section><!-- optional -->
<txp:output_form form="footer" />
OT: Static pages are single sections. Single sections are simply excluded from showing on the default startpage by deactivating that feature in the conten/section admin area. Another way to hide TXP ‘things’ from showing up on TXP pages is to consider using all the beautiful if/else core tags in TXP and the many parameters for all the other available TXP tags. Start to memorize the Alphabetical Tag Listing to realize further TXP ‘miracles’.
Edit: Put your static content simply on the section page template. You can (of course) list single articles with article forms and by ID but in your case I recommend to put the content on the section default page. Calling the section (/work) brings up the static page. Bingo.
Add some standard theme and study (or copy and paste) the ‘txp:tag’ structure. Do not care about the design or CSS. Check out the forms used and extend them.
Last edited by merz1 (2007-05-12 11:22:41)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#279 2007-05-12 11:54:04
- John Wozniak
- Member
- Registered: 2006-10-20
- Posts: 37
Re: tru_tags: A tagging plugin for textpattern
merz1 – Those are some fantastic suggestions that I am sure to get to sometime this weekend.
I will post back with an update when I have one.
Much thanks again.
Offline
#280 2007-05-12 16:09:02
Re: tru_tags: A tagging plugin for textpattern
- Grouping of keywords: select a group and all keywords go to the keyword field
Marcus, fantastic ideas and I particularly like the one above but is this for the admin or public side?
Personally, I’d prefer it for the public side. As my site grows in content it would be a nice feature if my
audience could select a group of keywords (tags) and the search is performed on their selection.
Offline
#281 2007-05-12 23:44:21
Re: tru_tags: A tagging plugin for textpattern
@John: You are welcome. Don’t expect too many miracles from the forum :-)
Always check twice that TXP tags are closed properly. Otherwise results can be horrible :)
@Sotoshi: “select a group of keywords” – This is answered somewhere at the beginning of this thread. Tru_tags is using core search function. AND search is not provided. OR search is provided: Link to comma separated tags i.e. “/tag/video,media”. Yes, a GUI is missing but as long as TXP core does not provide AND searches it is pretty useless (if you mainatin a bigger site).
Lets wait patiently and see what comes next … Nice weekend to everybody!
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#282 2007-05-15 00:53:18
Re: tru_tags: A tagging plugin for textpattern
merz1 – thanks for your help :)
Offline
#283 2007-05-15 22:43:14
- John Wozniak
- Member
- Registered: 2006-10-20
- Posts: 37
Re: tru_tags: A tagging plugin for textpattern
OK, so I have gotten to know tru_tags a little bit better and got it to perform more or less how I would like.
I read the documentation and looked at keep and sort.
This is what I have:
function tru_tags_get_standard_cloud_atts($atts, $isList, $isArticle) {
return lAtts(array('wraptag' => ($isList ? '' : ''),
'break' => ($isList ? '' : ' '),
'class' => '',
'breakclass' => '',
'section' => '',
'minpercent' => '100',
'maxpercent' => ($isList || $isArticle ? '100' : '200'),
'showcounts' => '',
'countwrapchars' => '[]',
'usereltag' => ($isArticle ? '1' : ''),
'generatelinks' => '1',
'mintagcount' => '0',
'maxtagcount' => '1000',
'setsizes' => ($isArticle ? '0' : '1'),
'usenofollow' => '',
'sort' => '',
'useoverallcounts' => '',
'setclasses' => ($isArticle ? '0' : '1'),
'title' => '',
'listlimit' => '',
'keep' => 'random',
'cutoff' => 'chunk',
'texttransform' => 'none',
'linkpath' => '',
'linkpathtail' => '',
'filtersearch' => '1',
'excludesection'=> '',
'activeclass' => 'tagActive'
),$atts, 0);
}
For some reason if I put keep=“random” inline it doesn’t show up random and also I tried through editing the above to get it to be random.
I would prefer to not have it inline because I want the tag cloud (at least for now) to appear the same everywhere and want it abstracted as much as possible.
I am sure it is something simple, but I don’t have that much left to go and appreciate the help a lot – I have so many details to tend to.
Thanks.
Offline
#284 2007-05-16 00:15:29
Re: tru_tags: A tagging plugin for textpattern
John – random
only applies if you have a listlimit
set, and then only if the listlimit
is smaller than the number of tags in the default cloud. I’m not sure what it would mean to have the complete tag cloud be ‘random’ – are you just looking for a random sort?
Offline
#285 2007-06-05 21:06:49
- John Wozniak
- Member
- Registered: 2006-10-20
- Posts: 37
Re: tru_tags: A tagging plugin for textpattern
So I am getting ever closer to being happy with the way my TXP install functions and hoping to go live soon.
One of the few issues left I would like to understand and address is the fact that if you have a link to a tag that does not exist (from an article that was deleted or the tag is incorrect for some other reason) it goes to a blank page, rather than the error page I have setup. Is there a way to get some error message, or my default error page to come up if the user has an URL with a tag that no longer exists (the story was deleted)?
Incorrect tag URL that goes to empty page
Last edited by John Wozniak (2007-06-05 21:16:48)
Offline
#286 2007-06-06 03:14:25
Re: tru_tags: A tagging plugin for textpattern
I can’t think of a way in the existing version to work around this, but I think there are a couple of possible solutions with code. I’m wondering how this happens, though – tru_tags shouldn’t ever generate a link that points to an invalid tag. Do you have hand-coded links to existing tags?
The ideal solution would be to redirect “depricated” tags to new, replacement tags. That’s a v4.0 feature, though :)
In the short term, I could support this behavior automatically – if tru_tags_handler is called for a tag that doesn’t exist, it could just do whatever it needs to do to tell TXP that it should render the 404 page. I’m not sure if that’s the right solution for everybody, but I can’t see an immediate problem with it. Anybody see an issue with that?
An alternative would be to provide a function like “tru_tags_if_tag_parameter_has_articles”, and then you could wrap tru_tags_handler with that, or show your error text if it returned false. It’s a bit hacky, but it would be backwards compatible.
Any other ideas? Either way, I’ll put it on the list for the next release (which is probably a month or so away, given my work schedule).
Offline
#287 2007-06-06 09:27:28
Re: tru_tags: A tagging plugin for textpattern
“tru_tags_if_tag_parameter_has_articles” is interesting. I love if/else tags :-)
Esp. for future keyword maintenance features in tru_tags this is an interesting situation. Some time ago we were talking about ‘keyword sets’. In this situation it becomes important to create a relation between keywords and to flag a keyword as outdated and invisible. This keyword would be replaced automatically by the appropriate/valid one from the ‘keyword set’. Even if an author uses the outdated keyword tru_tags would automagically use and publish the valid keyword. Back to the redirect feature: Surfing to tag/outdated will show the result page for tag/valid.
And yes, a standard 404 behavior should be implemented as search engines tend to keep links for a long time.
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#288 2007-06-06 14:54:58
- John Wozniak
- Member
- Registered: 2006-10-20
- Posts: 37
Re: tru_tags: A tagging plugin for textpattern
truist wrote:
I’m wondering how this happens, though – tru_tags shouldn’t ever generate a link that points to an invalid tag.
John Wozniak wrote:
This happens when an article gets indexed by a search engine and then the article is deleted.
I had some “dummy content” up that was crawled but I have since deleted it – I see in my logs that these URLS are still occasionally hit. I just don’t want to confuse incoming visitors – ideally.
Last edited by John Wozniak (2007-06-06 18:16:08)
Offline