Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (44 sloc) 2.21 KB
= Tags extension
Created by: Benny Degezelle -
Version: 0.1.2
Contact: benny AT gorilla-webdesign DOT be
This extension enhances the page model with tagging capabilities, tagging as in "2.0" and tagclouds.
== Requirements
This extension depends on the shards extension and the has_many_polymorphs plugin
Shards should be installed and loaded first; you can change the load order of extensions in config/environment.rb (see
== Installation
1. Copy the extension to your vendor/extensions directory as you would any other extension.
2. From your instance root, run 'rake db:migrate:extensions' to create meta_tags & taggings tables.
3. Then run 'rake radiant:extensions:tags:install'
Which will copy tags.css to your stylesheets folder. You might want to edit this file.
4. Add the tags.css to your layout;
<link rel="stylesheet" type="text/css" href="/stylesheets/tags.css" />
5. Make a page to sit in /search/by-tag, and give it the "Tag Search" pagetype.
If you want to change this location, it's in Radiant::Config['tags.results_page_url'].
Copy the results page example below, and modify to your likings;
== Results page
<h2>I couldn't find anything tagged with "<r:search:query/>".</h2>
<h2>Found the following pages that are tagged with "<em><r:search:query/></em>".</h2>
<li><r:link/> - <r:author/> - <r:date/></li>
== Tag cloud
Use <r:tag_cloud /> anywhere you like.
I made a stab at building the 'perfect' tag cloud markup, as inspired by a post on;
== Tag list
Use <r:tag_list /> to get a list of tags for the current page.
Also works through children:each.
== Collections
You can grab a collection of pages with a certain tag like so;
<r:tagged with="sometag" [scope="/some/page"]>
<r:link />
Which would iterate over all the resulting pages, like you do with children:each.
When you define scope, only this page and any of it's (grand)children will be used.
You can also set limit, offset etc like with children:each.