Hi Mika,
for tagging and a tag cloud you can use the infotags plugin (it's good and
should work with the latest v3.xxx).
Download the plugin here:
http://www.boltwire.com/index.php?p=solutions.links.infotags
The description on the doc page is garbled. Find the original page content
below. To use the script in v4 you need to adapt the forms to the new
conventions.
Function is like this:
You use a form to set tags on a page. It sends the tags to another page
info.tags that collects the tags with the links to the pages. You use a
second script to fetch the tags from there and display or alter them on the
tagged page.
To use the tags as links you create an action page action.tags.missing.
Since there is no page named "tag.xxx" anywhere, the system would display a
404 -not found page. This action overrides this behaviour. It creates a
page that show the links to the pages with that tag ("xxx") on it. Clever,
eh?
I hope this helps.
Greetings, Martin
Infotags:
This script contains a couple extensions to the info function/command to
give you a very simple, easy to setup tagging system.
To use it, enable the script as normal. Then, put code like the following
on a group footer (like "dances"):
Tags: [(list '{info.tags::{p}}' delimiter=' ' join=' | '
fmt='[[?tag.{+p}|+]]')] [ [[{p}&action=tags|Edit]] ]
This will draw in any existing tags from the tags data value and display
them.
Tagging content
If you want to set tags on pages that already exist, you create an action
page. Name the page action.tags and put these lines in it:
! >>Tags<<
>>Use this form to change the tags on this post:<<
[[{p}|+]]
[form]
[text tags "{info.tags::{p}}" size=50] [submit SAVE]
[session info "field='{p}' value='{=tags}' target='info.tags'"]
[form]
If you want to set tags in the form that initially creates the page, like a
blog entry form or something, just add the two from lines above to your
form. The first line won't have a default value of course.
You can manually inspect and/or edit your tag values manually by going to
info.tags.
This script also comes with a tag cloud feature you can put in a sidebar,
used like the following:
[(info tagcloud target=info.tags)]
To keep track of deleted pages/tags in your tagcloud you might add a line
like this to action.delete:
[session info "delete field='{p}' target='info.tags'"]
This clears your info.tags out of the pages which exist no more.
To use these links, create a page called action.tag.missing with content
like the following:
! Tags
Posts with Tag: //{{p2}:title}
[(info tags "{p2}" target=info.tags template="title")]
Then when you click on a link in the tag cloud (or any link to tag.whatever
it will go to a search page that generates a list of all pages with that
tag. Actually, you will want to do this even if you do not use the tag
cloud. It will return any page with the string links somewhere in the tags
(just using a simple strpos function).
There are probably still a few more features to add to this, like a way to
generate a list of links on a page to all tags. But we're on our way. I'm
open to suggestions--as I'm developing this for my own blog right at the
moment and would like to get it perfected.
Note:
If you care about consistent use of tags, you might get a list of all tags
which are used. Put this at the end of infotags.php:
function BOLTinfoTagList($info, $args) {
$tags = array();
foreach ($info as $f => $v) $tags = array_merge($tags, explode(',',
$v));
foreach ($tags as $tag) $tagcount[$tag] = $tagcount[$tag] ;
ksort($tagcount);
foreach ($tagcount as $i => $ii) {
$out .= " [[?tag.$i|+]] ";
}
return $out;
}
and call this on your page:
[(info taglist target=info.tags)]
Of course you can keep more than one tag list. You could have an additional
list for categories too. Just use the scripts above and use them on a page
action.categories.missing, action.categories and create a page
info.categories. Replace tags with categories inside the forms.
Search for tags
Some examples for searching single tags by using conditionals:
Find all pages WITHOUT tag "this_not":
[(info report target=info.tags if="!inlist 'this_not' '{info.tags::{+p}}'"
template="{+p}")]
Find all pages with tag "this" OR "that":
[(info report target=info.tags if="inlist 'this'
'{info.tags::{+p}}'||inlist 'that' '{info.tags::{+p}}' " template="{+p}")]
Find all pages with tag "this" AND "that":
[(info report target=info.tags if="inlist 'this'
'{info.tags::{+p}}'&&inlist 'that' '{info.tags::{+p}}' " template="{+p}")]
Find all pages with tag "this" AND "that" BUT NOT "this_not":
[(info report target=info.tags if="(inlist 'this'
'{info.tags::{+p}}'&&inlist 'that' '{info.tags::{+p}}')&&!inlist 'this_not'
'{info.tags::{+p}}' " template="{+p}")]
You could combine this with additional lists like a categories list. Just
change the target expression from {info.tags::{+p}} to
{info.categories::{+p}} or another page name starting with info
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.