Kristjan Jansen

Lessons learned in Drupal meta system

Here's some shared experiences I've gained when creating my Drupal site and using its meta system. Actually, its kinda a second installment of series – first part was posted to Drupal-devel mailing list

Here's what I've done:

1. Creating vocabulary

Or in Drupal-speak: creating collection of metatags.

Because my site is about travelling, I had to tie every content item (node) with a geographic location(s). In other words: I had to build up a controlled vocabulary of geographic locations an apply index terms to each node (is it correct, jibbajabbaboy?)

The biggest problem with geographic hierarchies is that you can't use tree-like stucture. The relations with geographic places are far more complex.

For example: Gibraltar – will I found it under category “Spain” (by geogr.location) or under “Great Britain” (political)? Canary Islands – under “Afica”, “Europe”, or “Spain” ?

When definining relations, the primary criteria I used was how Average Joe usually looks for countries. When he mind-maps Canaries to Africa – its ok with me. But just in case I add index terms “Europe” and “Spain” as well.
Anyways, using Drupal 3.0 metatags building such vocabulary is trivial. I defined the collection “Destination” and started adding tags.

 Name: “Africa – Botswana” Attributes: “Africa, Botswana” Collection: “Destination” 

The full list is here: http://trip.ee/module.php?…
As you problaly notice, there's some tags (destinations) twice. This is correct, in there are many cases when some term happens to fall into several categories (in real world: destination crosses the country borders). Examples:

 Africa – Maroc – Sahara Africa – Tunisia – Sahara 

or

 Europe – Austria – Alps Europe – France – Alps Europe – Germany – Alps Europe – Switzerland – Alps Europe – Italy – Alps 

The power of meta.module Ok, time to test out some tags.
Clicking on “Etna” tab (volcano in Italy)…What? Why I see endless list of Vietnam stories?
It seems Drupal is pretty loose when getting nodes from database by attribute. Instead

attributes LIKE ‘%“.$meta.”%’

its should be far more stict.I patched node_attributes_save() to save all attributes separated with commas and always use whitespace in start: " attribute, attribute,". New query looks as follows:

attributes LIKE ‘% “.$meta.”,%’

I'm sure this patch can be implemented much cleaner way, help me out here :)

2. Assigning attributes to nodes

I've been through a laborious 4-month tagging process and the conclusion is clear – first you must retreive from source as much metadata as possible, using machine processing, and then have complete the tagging manually (reviewing and adding data)

Read about the pains of process from my drupal-devel posting

3. Presenting attributes to user

The only place where Drupal show attributes is in $theme->node(), by function node_index().

Function does something really simple – maps every attribute to a link

<a href=index.php?meta=attribute>attribute</a>

.
First, it should be more flexible than that. Presenting attributes to user is a matter of UI, it should not directly derived from storing mechanism. It should take account the metatag name, not just the attributes. Also, someone would like to display an icon (a la Slashdot's topic images) instead of plain link etc. Configurability needed
Second – why map it to index.php? index.php is just a placeholder, instead it should be mapped to some module as parameter $meta:

 <a href=module.php?mod=some_module&meta=attribute>attribute</a> 

While ago I suggested collection handlers – basically this means you can say for each attribute where to map it (what module should accept it as a parameter).
For example, if I have defined metatag collection “Destination” and have a special module destinations.module for displaying destinations, node_index() should map attribute “Spain” to a

<a href=module.php?mod=destinations&meta=Spain>Spain</a>

Time has passed and now I'm sure there are be a better options (passing global variables is just ugly).

All this is getting to complicated in my head. I've been thinking is use the similar system to user roles and permissions – every module can define a new set of features (a la “user permissions”), what can be later assigned to metatags as “roles” – a new UI for a attribute link, mapping to Dublin Core, assigning to a template etc.

More ideas regarding meta attributes:

  • Metatag-based templates: I'm not in the state to come up with a proposal, but there were ideas hanging around how to assign templates to certain metatag.
    Something ala Manila metatag plugin: http://zelotes.ent.iastate.edu/…/managetypes http://zelotes.ent.iastate.edu/…/storyReader$229
    “Metatags is the glue that ties everything together” – that was the slogan we used back then :)
  • Dublin Core support: This goes together with improved newsfeed import-export. When RSS 1.0 (not yet supported in export) goes in/out from Drupal, it shoud carry DC tags and these should be auto-mapped to/from Drupal metadata.
  • Distributed conrolled vocabularies (categories):
    Here's my favourite subject :)

    Currently we use XML-RPC cloud to gather together a dynamic list of Drupal sites http://www.drupal.org/node.php?id=3, but there's far more opportunities.

    I'd like to see a distributed controlled vocabulary where every Drupal site can suggest (and retreive) some index terms to/from central server via XML-RPC. Sever can then compile a master list of terms and generate something like SuperOpenDirectory. This has been already suggested by Moshe: http://mail.zind.net/…/002379.html

    There has been some similar work in RSS camp, namely Syndic8 project. http://www.syndic8.com/services.php (See functions like SetFeedCategory, GetCategory* …)
    RSS categorization is under discussion in Syndic8 mailinglist: http://groups.yahoo.com/…/message/678 http://groups.yahoo.com/…message/2658

  • Localization: Although studied some papers, I still haven't found research about localization efforts (jibbajabba – help :). There should be an option to map index terms from one language to another. It's ok to use English-based controlled vocabularies in export-import (flowing content), but for localized sites there should be an option to display index terms in local language.

writing about this issue in

writing about this issue in such a smart way, showing us all different sides to it. Youre a great blogger. Please keep it up. I cant wait to read whats next. how to teach a child to read

Se on niin mukavaa. Kiitos,

Se on niin mukavaa. Kiitos, blogisi on erittäin hyödyllinen minun esseitä. Palaan enemmän ja innolla kavereiltani. kiitos Browse beach villa for rent collection and get ready for your ideal escape. Try vacation house rentals to book villas online for your holiday with your partner.

perhaps this is one of the

perhaps this is one of the most interesting blogs that I have ever seen. Interesting article, Funny comment. Keep it up

3 recension

I am very glad that I find

I am very glad that I find your regular post here. Which seems to be very important and it made good time pass for me.

review
PDF Review

Excellent post! PLease could

Excellent post! PLease could you check “first part” link?

It seems broken for me and I would like to take a view on it.

Thanks Michael daycare

Thanks so much for this!

Thanks so much for this! I have not been this thrilled by a blog post for quite some time! You’ve got it, whatever that means in blogging. Anyway, You’re definitely someone that has something to say that people should hear. Keep up the wonderful job. Keep on inspiring the people!very useful info for me.Because i'm new in blogging and i'm need good tutorial like your post. Nice to visit here, and don't forget to visit our blog to and give me more spirit to continue my blogging activities.I really loved reading your blog.642–661 braindump/642–681 brain dumps/642–691 dumps/642–813 brain dumps/642–832 dumps/642–874 braindump/642–902 exam dumps/free 642–971 dumps

Thanks for your marvelous

Thanks for your marvelous posting! I actually enjoyed reading it, you will be a great author.I will ensure that I bookmark your blog and will come back in the foreseeable future. I want to encourage that you continue your great job, have a nice weekend!think you’ve made some truly interesting points. Not too many people would actually think about this the way you just did. I’m really impressed that there’s so much about this subject that’s been uncovered and you did it so well, with so much class. Good one you, man! Really great stuff here.642–437// SY0–201// MB2–866// MB5–858// 156–215.71// 312–50v7// 642–874// 70–573//

This is how most people want

This is how most people want to use Drupal's attributes, I assume, and they may also want some sense of relationship (perhaps hierarchical, perhaps not) between each subject. wage garnishment

your way of representation

your way of representation with picture is good…very well written and represent step by step

mobilt kontantkort

I have been working with that

I have been working with that meta attributes for a pair of months now, I still don´t get it completely, but I am sure as time goes on I will have more experience and will do less fails.

Meta Hollengaugh from claim disability insurance

your way of representation

your way of representation with picture is good…very well written and represent step by step.oil mill

I visited this page first

I visited this page first time and found it Very Good Job of acknowledgment and a marvelous source of info.........Thanks Admin!

i like the information

i like the information here
how to jailbreak ps3
With ps3 Jailbreak you can host a challenge lobby for modern warfare 2, with this you can cheat all your way up to the achievements
jailbreak ps3
in jailbreaking your ps3 and more! how to jailbreak ps3 4.00 all the playstation jailbreak 3.72 details and software
ps3 jailbreak
.Thanks for the info here i got more info about memory foam mattress toppers its quit an interesting read there Mattress toppers are designed to protect your mattress so that it would have a longer life span it protects the mattress from stains and wine or liquid spills and any elements that could damage your mattress. Today you
memory foam mattress topper
can find different types of mattress toppers

This is very much happy for

This is very much happy for the great technology Northern Port University is visible in this website that to really appreciate for the great technology in this blog Northern Port University.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Twitter-style @usersnames are linked to their Twitter account pages.
  • Twitter-style #hashtags are linked to search.twitter.com.
  • You can use Texy! to format and alter entered content.
  • Allowed HTML tags: <a> <strong> <em> <li> <ol> <u> <ul> <blockquote> <pre> <code> <h3> <h4> <h5> <img> <dl> <dt> <dd> <strike> <script> <embed> <iframe>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.

More information about formatting options