Can anyone provide instruction to doing a template override to nodes to may the submitted by username include the rel="author" attribute?
Google is recognizing this attribute in search results but drupal doesn't allow this by default in versions 7 and prior. Is there a way to do this in the theme without screwing up any of the core rdf metadata?
Thanks!

Comments

Cellar Door’s picture

To override a template, locate the .tpl file in the omega core you want to edit and copy/paste into your subtheme's template file. You can then add the markup and it'll take. Shouldn't have any effect on the other RDF data.

AlexanderPop’s picture

scor’s picture

For the record rel="author" is compatible with RDFa. Leaving this issue open in case the maintainers want to support that in omega, #1444856: D7: how to add rel="author" to the "Submitted by" link? shows some examples.

apmsooner’s picture

I actually stole some code from adaptive theme and put it into my template.php and it works great.

/**
 * Preprocess variables for the username.
 */
function mytheme_preprocess_username(&$vars) {
  global $theme_key;
  $theme_name = $theme_key;
  // Add rel=author for SEO and supporting search engines
        if (isset($vars['link_path'])) {
          $vars['link_attributes']['rel'][] = 'author';
        }
        else {
          $vars['attributes_array']['rel'][] = 'author';
  }
}
apaderno’s picture

Component: Feature Request » Code
Category: Feature request » Support request
Issue summary: View changes