Problem/Motivation

Some advanced markup techniques—like that provided by schema.org—require field wrappers to have custom attributes, rather than just classes. This is becoming an increasingly important SEO issue as search engines give preference to sites providing this data. However, there is currently no simple way to add these attributes to fields without creating numerous custom templates or field formatters.

Proposed resolution/User interface changes

Provide an "Attributes" text field for each element, just like is done now for classes. Site builders could then type in whatever they want and the whole thing could be inserted into the element tag.

Original report by oskar_calvo

Semantic fields is great, but I want to use with schema (schema.org) I must to update the tpls because the schema.org use properties instead of class to define the type of elements in a html document.

Would be great to be able to add html properties to the fields.

oskar

Comments

jstoller’s picture

+1. I was just looking to do the exact same thing.

petsagouris’s picture

I agree this would be nice to have, although shouldn't the microdata specification be fixed so that we avoid running around it until it settles?

oskar_calvo’s picture

There are two modules that can help

http://drupal.org/project/schemaorg

http://drupal.org/project/microdata

But, still will be great to decide how to put another properties.

Oskar

jstoller’s picture

Title: let people to add also new properties to the fields. » Allow custom attributes on Semantic Field wrapper tags

I updated the Issue Summary, using the template, and clarified the title

@George Petsagourakis: If arbitrary attributes are permitted, then we won't be tied to any specific specification. That seems like the best way to go.

jstoller’s picture

Issue summary: View changes

Clarify issue summary, using the issue summary template.