Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a module that creates HTML output. Does it need to support the Drupal 7 RDF module?
What are the functions made available from the RDF module that allows a module to integrate with it? What hooks does the module use?

share|improve this question
up vote 3 down vote accepted

Themes will work with the RDF module if they use the proper attributes variables.

If you are generating HTML outside of the core theming (which seems unusual) system you will need to get this information yourself. The RDF mapping api is quite well documented. Essentially there is a mapping between fields and RDF. So a title field could have a mapping of dc:title.

In summary

You can then add rdfa markup to the fields as you output them.


If you are using standard theme functions, then so long as you stick to the D7 guidelines all of the RDF magic should be done for you. Specifically make sure that you use $attributes $title_attributes and $content_attributes.

If you want to know how to define RDF mappings, then please ask more questions.

share|improve this answer
It doesn't seem unusual for a module to define theme functions; in fact, it's the Node module (one of the core modules) that defines the template to use to render a node. It is better to not output a lot of HTML outside a theme function, that is true; doing so, other modules (and themes) would not be allowed to change the HTML output. – kiamlaluno Mar 3 '11 at 15:12
Defining theme functions is not unusual, 'creating HTML output' felt like you were doing something outside of the theme system. – Jeremy French Mar 3 '11 at 16:15
I didn't say how the HTML output is created. I usually use theme function for the output produced by the modules I maintain. – kiamlaluno Mar 6 '11 at 22:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.