Commit 079dca8e authored by Dries's avatar Dries
Browse files

- Patch #608036 by effulgentsia: add content_attributes() variable for tpl...

- Patch #608036 by effulgentsia: add content_attributes() variable for tpl files, so RDF can be implemented better.
parent 29a574e0
......@@ -2078,9 +2078,11 @@ function template_preprocess(&$variables, $hook) {
// Initialize html class attribute for the current hook.
$variables['classes_array'] = array($hook);
// Initialize attributes for the top-level template entity and its title.
// Initialize attributes for the top-level template entity and its title and
// content.
$variables['attributes_array'] = array();
$variables['title_attributes_array'] = array();
$variables['content_attributes_array'] = array();
// Set default variables that depend on the database.
$variables['is_admin'] = FALSE;
......@@ -2107,9 +2109,10 @@ function template_process(&$variables, $hook) {
// Flatten out classes.
$variables['classes'] = implode(' ', $variables['classes_array']);
// Flatten out attributes and title_attributes.
// Flatten out attributes, title_attributes, and content_attributes.
$variables['attributes'] = drupal_attributes($variables['attributes_array']);
$variables['title_attributes'] = drupal_attributes($variables['title_attributes_array']);
$variables['content_attributes'] = drupal_attributes($variables['content_attributes_array']);
}
/**
......
......@@ -46,7 +46,7 @@
<h2<?php print $title_attributes; ?>><?php print $block->subject ?></h2>
<?php endif;?>
<div class="content">
<div class="content"<?php print $content_attributes; ?>>
<?php print $content ?>
</div>
</div>
......@@ -66,7 +66,7 @@
?>
</div>
<div class="content">
<div class="content"<?php print $content_attributes; ?>>
<?php
// We hide the comments and links now so that we can render them later.
hide($content['links']);
......
......@@ -43,7 +43,7 @@
<?php if (!$label_hidden) : ?>
<div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
<?php endif; ?>
<div class="field-items">
<div class="field-items"<?php print $content_attributes; ?>>
<?php foreach ($items as $delta => $item) : ?>
<div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
<?php endforeach; ?>
......
......@@ -100,7 +100,7 @@
</div>
<?php endif; ?>
<div class="content">
<div class="content"<?php print $content_attributes; ?>>
<?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
......
......@@ -11,5 +11,5 @@
<h2 class="title"<?php print $title_attributes; ?>><?php print $block->subject ?></h2>
<?php endif;?>
<div class="content"><?php print $content ?></div>
<div class="content"<?php print $content_attributes; ?>><?php print $content ?></div>
</div>
......@@ -19,7 +19,7 @@
<h3<?php print $title_attributes; ?>><?php print $title ?></h3>
<div class="content">
<div class="content"<?php print $content_attributes; ?>>
<?php hide($content['links']); print render($content); ?>
<?php if ($signature): ?>
<div class="clearfix">
......
......@@ -17,7 +17,7 @@
<span class="submitted"><?php print $date; ?><?php print $name; ?></span>
<?php endif; ?>
<div class="content clearfix">
<div class="content clearfix"<?php print $content_attributes; ?>>
<?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment