Issue #1642070 by Schnitzel: Make use of entity labels in templates.
parent
dfbddf1e96
commit
27b89c3fd0
|
@ -1338,7 +1338,7 @@ function template_preprocess_node(&$variables) {
|
||||||
|
|
||||||
$uri = $node->uri();
|
$uri = $node->uri();
|
||||||
$variables['node_url'] = url($uri['path'], $uri['options']);
|
$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);
|
$variables['page'] = $variables['view_mode'] == 'full' && node_is_page($node);
|
||||||
|
|
||||||
// Flatten the node entity's member fields.
|
// Flatten the node entity's member fields.
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* Default theme implementation to display a node.
|
* Default theme implementation to display a node.
|
||||||
*
|
*
|
||||||
* Available variables:
|
* 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,
|
* - $content: An array of node items. Use render($content) to print them all,
|
||||||
* or print a subset such as render($content['field_example']). Use
|
* or print a subset such as render($content['field_example']). Use
|
||||||
* hide($content['field_example']) to temporarily suppress the printing of a
|
* hide($content['field_example']) to temporarily suppress the printing of a
|
||||||
|
@ -82,7 +82,7 @@
|
||||||
|
|
||||||
<?php print render($title_prefix); ?>
|
<?php print render($title_prefix); ?>
|
||||||
<?php if (!$page): ?>
|
<?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 endif; ?>
|
||||||
<?php print render($title_suffix); ?>
|
<?php print render($title_suffix); ?>
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
* such as render($content['field_example']). Use
|
* such as render($content['field_example']). Use
|
||||||
* hide($content['field_example']) to temporarily suppress the printing of a
|
* hide($content['field_example']) to temporarily suppress the printing of a
|
||||||
* given element.
|
* given element.
|
||||||
* - $term_url: Direct url of the current term.
|
* - $url: Direct url of the current term.
|
||||||
* - $term_name: Name of the current term.
|
* - $label: Name of the current term.
|
||||||
* - $attributes: An instance of Attributes class that can be manipulated as an
|
* - $attributes: An instance of Attributes class that can be manipulated as an
|
||||||
* array and printed as a string.
|
* array and printed as a string.
|
||||||
* It includes the 'class' information, which includes:
|
* It includes the 'class' information, which includes:
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<div id="taxonomy-term-<?php print $term->tid; ?>"<?php print $attributes; ?>>
|
<div id="taxonomy-term-<?php print $term->tid; ?>"<?php print $attributes; ?>>
|
||||||
|
|
||||||
<?php if (!$page): ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
|
@ -630,8 +630,8 @@ function template_preprocess_taxonomy_term(&$variables) {
|
||||||
$term = $variables['term'];
|
$term = $variables['term'];
|
||||||
|
|
||||||
$uri = $term->uri();
|
$uri = $term->uri();
|
||||||
$variables['term_url'] = url($uri['path'], $uri['options']);
|
$variables['url'] = url($uri['path'], $uri['options']);
|
||||||
$variables['term_name'] = check_plain($term->name);
|
$variables['label'] = check_plain($term->label());
|
||||||
$variables['page'] = $variables['view_mode'] == 'full' && taxonomy_term_is_page($term);
|
$variables['page'] = $variables['view_mode'] == 'full' && taxonomy_term_is_page($term);
|
||||||
|
|
||||||
// Flatten the term object's member fields.
|
// Flatten the term object's member fields.
|
||||||
|
|
Loading…
Reference in New Issue