Inline Tag Edition Snippet
This snippet will let you edit tags directly while viewing the wiki page you want to tag via a basic text input field. Follow these steps:- Create a new wiki page
- Edit it and save it with the following text: #includeForm("Panels.PanelSheet")
- Add a "Panels.PanelClass" instance to the page
- Put the code below in the content field of the panel
Code
#if ($context.action == "view") #panelheader("Tags") #set ($tags = $doc.tags.split("[|]")) #set($existingTags = $xwiki.arrayList) #foreach($tag in $!tdoc.tags.split("[|]")) #set($discard = $existingTags.add($tag)) #end #if ($existingTags.size()>0 && $existingTags.get(0).length()>0) #foreach ($tag in $existingTags) * <a href='$xwiki.getURL("Main.Tags")?tag=$tag'>$tag</a> #end #end <form action="$xwiki.getURL($doc.fullName,"save")" method="get"> <center> <input name="tags" value="$!doc.tags" type="text"/> <input type="submit" value="Update tags"/> </center> </form> #panelfooter() #end
Result
See also a live example.
Version 3.1 last modified by VincentMassol on 09/12/2007 at 14:18
Comments: 0