Issue #1642070 by Schnitzel: Make use of entity labels in templates.

8.0.x
catch 2012-08-29 10:52:19 +01:00
parent dfbddf1e96
commit 27b89c3fd0
4 changed files with 8 additions and 8 deletions

View File

@ -1338,7 +1338,7 @@ function template_preprocess_node(&$variables) {
$uri = $node->uri();
$variables['node_url'] = url($uri['path'], $uri['options']);
$variables['title'] = check_plain($node->title);
$variables['label'] = check_plain($node->label());
$variables['page'] = $variables['view_mode'] == 'full' && node_is_page($node);
// Flatten the node entity's member fields.

View File

@ -5,7 +5,7 @@
* Default theme implementation to display a node.
*
* Available variables:
* - $title: the (sanitized) title of the node.
* - $label: the (sanitized) title of the node.
* - $content: An array of node items. Use render($content) to print them all,
* or print a subset such as render($content['field_example']). Use
* hide($content['field_example']) to temporarily suppress the printing of a
@ -82,7 +82,7 @@
<?php print render($title_prefix); ?>
<?php if (!$page): ?>
<h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>" rel="bookmark"><?php print $title; ?></a></h2>
<h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>" rel="bookmark"><?php print $label; ?></a></h2>
<?php endif; ?>
<?php print render($title_suffix); ?>

View File

@ -11,8 +11,8 @@
* such as render($content['field_example']). Use
* hide($content['field_example']) to temporarily suppress the printing of a
* given element.
* - $term_url: Direct url of the current term.
* - $term_name: Name of the current term.
* - $url: Direct url of the current term.
* - $label: Name of the current term.
* - $attributes: An instance of Attributes class that can be manipulated as an
* array and printed as a string.
* It includes the 'class' information, which includes:
@ -41,7 +41,7 @@
<div id="taxonomy-term-<?php print $term->tid; ?>"<?php print $attributes; ?>>
<?php if (!$page): ?>
<h2><a href="<?php print $term_url; ?>"><?php print $term_name; ?></a></h2>
<h2><a href="<?php print $url; ?>"><?php print $label; ?></a></h2>
<?php endif; ?>
<div class="content">

View File

@ -630,8 +630,8 @@ function template_preprocess_taxonomy_term(&$variables) {
$term = $variables['term'];
$uri = $term->uri();
$variables['term_url'] = url($uri['path'], $uri['options']);
$variables['term_name'] = check_plain($term->name);
$variables['url'] = url($uri['path'], $uri['options']);
$variables['label'] = check_plain($term->label());
$variables['page'] = $variables['view_mode'] == 'full' && taxonomy_term_is_page($term);
// Flatten the term object's member fields.