summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2012-08-29 09:52:19 (GMT)
committercatch2012-08-29 09:52:19 (GMT)
commit27b89c3fd0f83c35bb531302d16379d198a37dfb (patch)
tree44aa8b842c780f028d66683d6af34f8d2d41840c
parentdfbddf1e96fc28e87285dcb24bbc96dd3bd5231a (diff)
Issue #1642070 by Schnitzel: Make use of entity labels in templates.
-rw-r--r--core/modules/node/node.module2
-rw-r--r--core/modules/node/node.tpl.php4
-rw-r--r--core/modules/taxonomy/taxonomy-term.tpl.php6
-rw-r--r--core/modules/taxonomy/taxonomy.module4
4 files changed, 8 insertions, 8 deletions
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 89032d1..f3849e0 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -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.
diff --git a/core/modules/node/node.tpl.php b/core/modules/node/node.tpl.php
index 624ac7d..e24ba40 100644
--- a/core/modules/node/node.tpl.php
+++ b/core/modules/node/node.tpl.php
@@ -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); ?>
diff --git a/core/modules/taxonomy/taxonomy-term.tpl.php b/core/modules/taxonomy/taxonomy-term.tpl.php
index 96ed8fc..07e1e47 100644
--- a/core/modules/taxonomy/taxonomy-term.tpl.php
+++ b/core/modules/taxonomy/taxonomy-term.tpl.php
@@ -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">
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index a772e02..4894cf1 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -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.