<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 8/13/2009 9:27 AM, Michael Fake wrote:
<blockquote
cite="mid:c9a0ce430908130627l5dcfab5blcbf8bff84363845e@mail.gmail.com"
type="cite">Hello everyone,<br>
<br>
I'd like to be able to set up a simple tagging system, whereby on each
page you can add a tag which acts as a direct link to another page.
E.g. You could tag the page 'Main/Daschund' with the 'Dogs' tag, and
clicking on that link would take you to Main/Dogs. I'd then like to
have the option to list, in Main/Dog, all those pages that have the
'Dogs' tag. This seems to be how tags in the ever-useful <a
moz-do-not-send="true" href="http://www.tiddlywiki.com/"
target="_blank">TiddlyWiki</a> work, and I'd like a similar navigation
option in pmwiki.<br>
</blockquote>
In your config.php:<br>
$CategoryGroup = 'Main';<br>
<br>
In Main.GroupFooter:<br>
(:pagelist link=Main/Dogs:)<br>
<br>
The stuff that follows this point might surprise you with how much
closer PmWiki can get to Tiddlywiki.<br>
<br>
-----<br>
<br>
I suggest you download and install the EditAttributes recipe like this:<br>
<br>
First, copy editattr.php into your cookbook.<br>
<br>
In you config.php:<br>
$EditAttrFields = array(<br>
'title' => array(<br>
'attribute' => 1,<br>
'markup' => '(:title $1:)',<br>
'filter' => 'EditAttrAutofillTitle'<br>
),<br>
'tags' => array(<br>
'attribute' => 1, <br>
'markup' => '(:tags:$1:)',<br>
'filter' => 'EditAttrFormatTags'<br>
)<br>
);<br>
<br>
# Format Tags<br>
function EditAttrFormatTags( $pagename, $fn, &$new ) {<br>
global $CategoryGroup;<br>
<br>
$EaCleanArray = array('[',']','!',<br>
'Category:',"$CategoryGroup:",<br>
'Category/',"$CategoryGroup/",<br>
'Category.',"$CategoryGroup."<br>
);<br>
<br>
$EaMatches = $new['tags'];<br>
$EaMatchesArray =
explode(',',str_ireplace($EaCleanArray,'',$EaMatches));<br>
<br>
Foreach($EaMatchesArray as $EaM) {<br>
$EaM = trim($EaM);<br>
<br>
if($EaM == '')<br>
$EaFixed .= '';<br>
elseif(strstr($EaM,'/') === FALSE && strstr($EaM,'.')
=== FALSE)<br>
$EaFixed .= '[[!'.$EaM.']], ';<br>
else<br>
$EaFixed .= '[['.$EaM.']], ';<br>
}<br>
<br>
$new['tags'] = substr($EaFixed,0,-2);<br>
}<br>
<br>
include_once($FarmD.'/cookbook/editattr.php');<br>
<br>
Finally, edit Site.EditForm. Just copy and replace:<br>
!!Editing {*$FullName}<br>
(:messages:)<br>
<div id='wikiedit'><br>
(:input e_form:)<br>
[[#top]]<br>
<table style="width:100%;"><br>
<tr><td
style="text-align:right;">Title:</td><td>(:input
e_title:)</td><td
style="text-align:right;">Tags:</td><td>(:input
e_tags:)</td></tr><br>
<tr><td colspan="4">(:input
e_textarea:)</td></tr><br>
<tr><td colspan="4">(:input e_savebutton:)(:input
e_savedraftbutton:)(:input e_saveeditbutton:)(:input
e_previewbutton:)(:input e_cancelbutton:)</td></tr><br>
</table><br>
(:input end:)<br>
</div><br>
(:if e_preview:)<br>
!!Preview {*$FullName}<br>
'''$[Page is unsaved]'''<br>
(:e_preview:)<br>
<hr /><br>
[[#top|Top]]<br>
(:ifend:)<br>
<br>
----<br>
<br>
Now, all you have to do is fill the Tags box with a comma separated
list of tags:<br>
Dogs, Friendly Dogs, Dogs with all their Teeth<br>
And you can even link outside your CategoryGroup like this:<br>
Pictures/Dogs, Stories.Dogs, Wolves.That look like Dogs<br>
<br>
You might also install the AutoSave and GetRidOfMain recipes for some
added functionality.<br>
<br>
Michael Continues<br>
</body>
</html>