Provide configuration settings to enable the use of RDFa in Drupal 6.x.

To make RDFa available as widely as possible, support automatically replacing the default DOCTYPE in any themed output with the XHTML+RDFa DOCTYPE, as well as adding in any needed namespace declarations to the HTML tag (these can both be implemented using PHP's output buffering).

Also evaluate whether the default HTML input filters need improvements in order to cleanly pass through RDFa properties.

Comments

Arto’s picture

Changeset [179044] implements the automatic DOCTYPE replacement. It works by looking for the opening HTML tag in the first 15 lines of output, and if the tag is found it replaces anything prior to that offset with the XHTML+RDFa 1.0 DOCTYPE declaration.

The replacement is done via PHP's output buffering mechanism and takes place after hook_exit() is run. This feature is most likely incompatible with Drupal's aggressive caching, and possibly (though not necessarily) with the static caching provided by Boost as well.

The feature only activates if the administrator has enabled it at admin/settings/rdf#rdfa, and only if the page being served actually contains an HTML response. This, along with the 15-line lookahead limit, ought to make it as robust as possible - which is needed, since error handling in the output buffer callback is all but impossible, and debugging any problems there ain't any fun either.

Please report any incompatibilities or bad interactions with other modules that you may experience.

Arto’s picture

Changeset [179078] implements a configuration option for selecting which namespace prefixes to enable for RDFa usage, and then injects those prefixes as xmlns:prefix="uri" attributes into the HTML opening tag.

There's more RDFa support that could be implemented, but this present level should now be enough to enable basic RDFa use for anyone who has the RDF module installed and is using the "Full HTML" input format to edit their content.

scor’s picture

Make sure however you don't allow the full HTML filter to be used by anonymous or non trusted users for security reasons.

digi24’s picture

The commit in #1 and #2 may render AJAX forms unusable, please see #476280: RDFa setting breaks json output of some modules and ahah functionality of cck buttons

billsdesk’s picture

It works, but generates a PHP error everytime the administrator changes pages. I reporter the error, along with trace details, against the RDF module. This is an important feature, but not usable in its current state.

3dloco’s picture

+1

Anonymous’s picture

Status: Active » Closed (won't fix)

I also said this in #847556: Status of RDFa in 6.x?, but I know that scor is planning on focusing on Drupal 7, and I don't think that any of the other maintainers are planning to take up the flag in Drupal 6, so I think that this is closed-won't fix.

samuel lavoie’s picture

Damn I was looking for that in Drupal 6, can't upgrad to 7 yet... Any module that does that? Microformats doesn't seems reliable.

Anonymous’s picture

AFAIK there is no reliable RDFa handling in Drupal 6.