Sorry in advance if I'm missing something here.

If we are going to use rdf_template_variable_attributes_array, we should allow for a way to set inline=FALSE.

rdf_process has a way to pass the inline value to theme_rdf_template_variable_wrapper, but I couldn't find a way to attach it to rdf_template_variable_attributes_array (so that the value is included in the processing in rdf_process) without actually including it in the attributes array.

Comments

effulgentsia’s picture

subscribing for review later.

effulgentsia’s picture

Status: Active » Closed (works as designed)

This is by design. The intention was to not have too many use-cases where rdf_template_variable_attributes_array is used at all, and especially where there's block-level HTML, because it's only for already rendered variables, and we're trying to move to having fewer already rendered variables, especially ones that require RDFa on them, but sadly, we just weren't able to convert everything to render arrays for D7, so this was needed to deal with those stragglers. I see your other issue #712914: rdf_template_variable_wrapper does not work for unrendered template variables, and will comment on that one when I have a chance, since we probably do need a consistent way to deal with adding RDFa to render array variables, but because of the power of the render system, we have many options available for doing that, and just need to pick one.

If there is a use-case of an already rendered variable containing block-level HTML that needs RDFa added, the way to do that is documented in the PHPDocBlock for theme_rdf_template_variable_wrapper(), where the 'inline' variable is explained. The module can implement hook_preprocess_rdf_template_variable_wrapper() with an if/switch on $variables['context'], and set $variables['inline'] there. Maybe not super-pretty, but should be rare, and I think it makes sense to have the separation of the semantic decision (the code that adds RDFa information in rdf_template_variable_attributes_array) from the theme layer stuff (a preprocess function for dealing with 'inline').