# Enhancing page model with acts\_as\_taggable

**URL:** <https://www.ruby-forum.com/t/enhancing-page-model-with-acts-as-taggable/125025>\
**Category:** Radiant CMS\
**Created:** [January 4, 2008, 5:25pm UTC](https://www.ruby-forum.com/t/enhancing-page-model-with-acts-as-taggable/125025 "2008-01-04T17:25:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jomz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@jomz](https://www.ruby-forum.com/u/jomz)\
**Post date:** [January 4, 2008, 5:25pm UTC](https://www.ruby-forum.com/t/enhancing-page-model-with-acts-as-taggable/125025/1 "2008-01-04T17:25:41Z")

</div>

Hi list,

I was wondering if anybody is using acts\_as\_taggable(\_on\_steroids) on  
their  
pages yet?

---

<div class="post-metadata">

**Author:** ![jomz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@jomz](https://www.ruby-forum.com/u/jomz)\
**Post date:** [January 7, 2008, 1:07pm UTC](https://www.ruby-forum.com/t/enhancing-page-model-with-acts-as-taggable/125025/2 "2008-01-07T13:07:39Z")

</div>

I had acts\_as\_taggable running, a long time ago, but the main problem  
is that Radiant uses the “Tag” namespace for the, well Tags (the  
radius ones, not organizatonal ones). I got around this by hacking it  
a bit a renaming the tags to Metatags. Worked fine.

More recently I have been using has\_many\_polymorphs, which seems to  
be a much better replacement for tagging that the various newer  
versions fo acts\_as\_taggable. It comes with a nice tagging generator  
and I spun that out into a small extension, which unfortunately broke  
with 0.6.4. I have not looked into it, as this was just a small  
personal project and I had people breathing down my neck for other  
more important things…

If you would like to play with the code, let me know, I will package  
it up.

keith

---

<div class="post-metadata">

**Author:** ![jomz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@jomz](https://www.ruby-forum.com/u/jomz)\
**Post date:** [January 7, 2008, 6:08pm UTC](https://www.ruby-forum.com/t/enhancing-page-model-with-acts-as-taggable/125025/3 "2008-01-07T18:08:19Z")

</div>

I was halfway through with adding acts\_as\_taggable\_on\_steroids, I think  
the  
tag handling in radiant has changed since your attempt, 'cause i had no  
problem with the namespace. I hadn’t read about has\_many\_polymorphs yet,  
seems like a good solution too.  
I’d sure be glad to try and fix your extension

Benny

> I had acts\_as\_taggable running, a long time ago, but the main problem  
> is that Radiant uses the “Tag” namespace for the, well Tags (the  
> radius ones, not organizatonal ones). I got around this by hacking it  
> a bit a renaming the tags to Metatags. Worked fine.

> More recently I have been using has\_many\_polymorphs, which seems to  
> be a much better replacement for tagging that the various newer  
> versions fo acts\_as\_taggable. It comes with a nice tagging generator  
> and I spun that out into a small extension, which unfortunately broke  
> with 0.6.4. I have not looked into it, as this was just a small  
> personal project and I had people breathing down my neck for other  
> more important things…

> If you would like to play with the code, let me know, I will package  
> it up.

> keith

> On Jan 4, 2008, at 5:24 PM, Benny D. wrote:
> 
> > Hi list,

> > I was wondering if anybody is using acts\_as\_taggable(\_on\_steroids)  
> > on their  
> > pages yet?
> > 
> > * * *
> > 
> > Radiant mailing list  
> > Post: Radi…[http://groups.google.com/groups/unlock?msg=d3c43bdfaf8247c6&\_done=/group/radiantcms/browse\_frm/thread/110e8a3c68fb3fa6%3F](http://groups.google.com/groups/unlock?msg=d3c43bdfaf8247c6&_done=/group/radiantcms/browse_frm/thread/110e8a3c68fb3fa6%3F)  
> > @lists.radiantcms.org

---

<div class="post-metadata">

**Author:** ![jomz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@jomz](https://www.ruby-forum.com/u/jomz)\
**Post date:** [January 8, 2008, 4:09am UTC](https://www.ruby-forum.com/t/enhancing-page-model-with-acts-as-taggable/125025/4 "2008-01-08T04:09:19Z")

</div>

“Benny D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Hi list,
> 
> I was wondering if anybody is using acts\_as\_taggable(\_on\_steroids) on their  
> pages yet?

No, but I’ve started something similar (code is still very alpha) that  
parses a page part as a YAML hash, indexes this and provides tags for  
accessing it. The basic idea is to allow any arbitrary structured  
data to be applied to a page in a simple way.

So, for example, you’d create a new page part called “meta” which  
would contain something like:

```
tags: ruby,coding,web_dev

```

or even something more complex like the data for an hcalendar:

```
id: apachecon_europe_2008
summary: ApacheCon Europe 2008
start_date: April 7
end_date: April 11
dtstart: 20080407
dtend: 20080411
location: Movenpick Hotel, Amsterdam
url: http://eu.apachecon.com
description: >
  ApacheCon is a week of open source goodness straight from the
  source of the Apache Software Foundation, featuring 15 intense
  training classes over two days followed by three days of more
  than 50 sessions by the creators of open source software such
  as the Apache webserver, Tomcat, Lucene, Wicket and more.

```

I can then access this as a tag like this:

```
<r:meta key="tags" />

```

I’m now working on a controller that would act as an index for this  
meta data:

```
http://example.com/{key}/{value}
                     ^ ^
                     | returns all pages with this key:value
                     returns a list of all values for the key

```

Anyway, I’m still just playing around with this and I’m not convinced  
yet if it’s a good idea, but it could certainly be used to (1) do  
tagging and (2) enhance the page model without any coding.

–  
J Aaron F. [jadetower.com](http://jadetower.com) [US] +1 724-964-4515  
é¦®å‚‘ä» [cubiclemuses.com](http://cubiclemuses.com) [HK] +852 8123-7905
