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?


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.

| 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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