Apr
9
Posted by:
Charles Nurse
4/9/2010
This article is cross-posted from my personal blog.
In DotNetNuke version 5.3, we introduced the concept of a centralized Content store, together with the ability to apply Taxonomies (categories) to the content. We have extended this in DNN 5.4 by completing the MetaData API as well as adding Folksonomy (user tags).
In this series of blogs I will explain how developers can take advantage of these new features in their own extensions.
But first lets take a look at how the pieces work together.
Defining Taxonomies
Taxonomy is defined as “the practice and science of classification” – Wikipedia, while Folksonomy is defined as “collaborative tagging” – Wikipedia.
Usually, taxonomy refers to the practice of using hierarchical categories applied to the content by a “content editor”, while folksonomy refers to the practice of free-form tagging of content by users.
In DotNetNuke, while we expose both of these at the presentation layer, in the API and Data Layer they are implemented using a common data structure.
Lets take a look at the new Taxonomy Manager, which can be found on the Admin menu.
Figure 1: The Taxonomy Manager in DNN 5.4
|
|
The initial view displays a list of the defined Vocabularies – In DNN 5.3 the list is empty, while in DNN 5.4 there is a single System Vocabulary defined called Tags.
To create a new Vocabulary click on the Create New Vocabulary button.
Figure 2: Creating a New Vocabulary
|
|
You can then enter a name and description for the Vocabulary and define whether it is a Simple or Hierarchical Vocabulary and whether it is an Application scope Vocabulary (host users only) or Portal scope Vocabulary.
Once you have added the Vocabulary you will return to the main Vocabulary list. To add “terms” to the Vocabulary select the Edit link.
Figure 3: Editing a Vocabulary
|
|
You can add “terms” to the Vocabulary by selecting the “Add Term” button.
Figure 4: Adding a Term to the Vocabulary
|
|
You can then enter a name and a description for the term and click Save.
To edit an existing term you can select the term from the Terms list.
Figure 5: Editing a Term in a Hierarchical Vocabulary
|
|
Note figure 5 shows a hierarchical Vocabulary, where the terms are displayed in a treeview, and you can define a Parent Term for the term, while Figure 6 shows a simple (flat) Vocabulary of colors where the terms are displayed in a list, and there is no Parent Term option.
Figure 6: Editing a Term in a Simple Vocabulary
|
|
Using Taxonomies
Now we have defined a couple of Vocabularies, how do we use them. Currently only two types of Content exists which can be “tagged” – Modules and Pages/Tabs. By providing support for tagging at the Page and Module level through Page Settings and Module Settings, modules do not need to be updated to support taxonomies. Modules, like Blog, Forum and Announcements which have multiple Content Items will need to be updated to support tagging at the item level though.
In figure 7 we can see how the terms “MP3 Players” from the Electronics Vocabulary and “Red” from the Colors Vocabulary can be applied to the Page.
Figure 7: Applying Taxonomy Terms (Categories) to a Page
|
|
Once the page has been categorized with some terms, if the page skin has the new Tags Skin object in it (like the base Index skin in Minimal Extropy), the skin object will display the list of categories that have been applied to the page. (Note the skin object can be styled in many different ways though css. In this case we are using a folder icon to indicate “categories” and a luggage label to indicate tags.
Figure 8: The new Tags Skin object
|
|
Adding Tags (Folksonomy)
Folksonomy is the practice of allowing users to enter their own tags in order to categorise or “tag” the content. The Tags skin object has a property/attribute – AllowTagging – which defaults to true that allows users to enter their own tags. The user, would click the Add Tags button.
Figure 9: Entering new Tags
|
|
The user could then enter a comma-delimited list of tags – click Save and the “Tags” would be saved (Figure 10)
Figure 10: The Tags Skin Object with Two New User-entered Tags
|
|
Tags System Vocabulary
It was briefly mentioned at the beginning of this article that there is a single System Vocabulary created when DNN 5.4 is installed. This Vocabulary is where the User entered Tags are stored.
Figure 11: The Tags System Vocabulary
|
|
There are a number of advantages of using a special System Vocabulary for storing user entered tags. One is that both taxonomy terms and folksonomy tags are treated in the API and Data Layer in the same way. This means that we only have to manage one relationship between content and terms rather than two separate relationships. The second benefit of treating tags in this way is that an admin can “manage” the tags – ie remove any offensive or inappropriate tags, or correct spellings of tags, by using the Taxonomy Manager UI.
I hope this has given you an idea of what the new Taxonomy/Folksonomy features can do. In future blogs I will take a deep-dive into the API and Data Layer of this new sub-system and show you how you can build rich content driven modules.
4 comment(s) so far...
Re: Content, MetaData and Taxonomy – 1 – Taxonomy Manager
Page Tagging is an option I have been very interested in. Beyond what you mention here, there are other very useful effects this could introduce. - Page Background images could be applied based on the tags. - Google Analytics variables could be based on tags.
Another enhancement would be an inherit function: This could work in two ways. 1> a button could be clicked that would say the tag should be inherited by children. A child page could reset it overriding the inheritance and even start a new inheritance chain.
2> They could be inherited by default, unless an override is set on the child pages.
This would be so powerful.
By Phil Speth on
4/12/2010
|
Re: Content, MetaData and Taxonomy – 1 – Taxonomy Manager
This is a great addition to dnn.
Shame though, in figure 7 when you select a term at either page or module level (mark the checkbox next to the term you want to use), it does an immediate post back. This makes adding more than one term very slow & personally I thinks it makes it very annoying to use. Why can't you select multiple items without a post back in between each item selected? See here for an example of what I mean (no post backs!) - dropdown-check-list.googlecode.com/svn/trunk/src/demo.html
Post backs are really a thing of the past & only should be used where absolutely required.
By Adam Kirkbride on
4/12/2010
|
Re: Content, MetaData and Taxonomy – 1 – Taxonomy Manager
I don't mean to snipe or snip, but with such helpful techdoc-ism insights as, "You can add 'terms' to the Vocabulary by selecting the 'Add Term' button", I couldn't help but notice that a very conspicuous notation is being used but not explained. It is used in all the figures but not in the text of this page. It is in front of All Users and Unauthenticated users roles but not the others. It is in front of most terms but book-ends Name, Description, Type and Scope. Maybe it is a taxonomy term that only a newbie would not recognize, but I thought this was an introduction. Should I be embarrassed?
Also how does this new feature integrate with the tags that were historically applied to pages in the tags section of the page. Were those not taxonomical?
In any case, anything that helps organize our, now interoperable, soon integrated, bulb of www data store is welcomed. I personally see the value of the bottom-up approach.
By Mark Stouffer on
7/10/2010
|
Re: Content, MetaData and Taxonomy – 1 – Taxonomy Manager
Thanks for this article. It has helped me understand taxonomy and new options in various modules. I can only suggest that you add a link to how to apply taxonomy in the real world, or a taxonomy best practice guide. I think taxonomy is a specialized skill and requires some thought and learning before using it.
Do these terms get output as HTML definitions eg. DL, DT,DD tags? www.w3.org/TR/html401/struct/lists.html.
By Jamie Clayton on
8/20/2010
|