Previously, node.tpl.php files could use the $taxonomy variable if they needed access to an array of unrendered taxonomy links associated with the current node.
In Drupal 7, this is no longer the case. Instead, all links have been moved into the $node object. The array of unrendered taxonomy links can now be found in $node->content['links']['terms']['#value'] instead. (Note that this array should be used with caution, since the text contained within it has not been escaped to prevent XSS attacks.)
Rendered taxonomy links are not affected; node.tpl.php files can continue to access these via the $terms variable, as before. In many cases, the $terms variable is what you want to use in your theme anyway, and you might be able to replace references to $taxonomy with it, as in the following example:
6.x
<?php if ($taxonomy): ?>
<div class="terms"><?php print $terms ?></div>
<?php endif;?>7.x
<?php if ($terms): ?>
<div class="terms"><?php print $terms ?></div>
<?php endif;?>Drupal 7 is able to output RDFa which requires the following changes in page.tpl.php.
lang attribute should be removed for compatibility with XHTML 1.1, only xml:lang should remain.html tag and are contained in the $rdf_namespaces variable.<head> tag.6.x
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>7.x
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>"
<?php print $rdf_namespaces ?>>
<head profile="<?php print $grddl_profile ?>">The “clear-block” class was a Drupalism for functionality that was better known by the CSS Community as the “clearfix” class. Also, using “block” in the old name was confusing to Drupal users more familiar with Drupal’s block system than with the properites inside that CSS ruleset. New themers and designers to the Drupal community will no longer be confused by the old class name.
If you had a <div class="clear-block"> in your D6 theme, simply change it to <div class="clearfix">.
The amorphous box.tpl.php template has been removed. Those pieces of content that were using the box.tpl.php now have their own theme function.
The search results listings are now themed with a theme_search_results_listing() theme function and the comment form box is themed with a theme_comment_form_box() theme function.
1 周 6 天之前
3 周 4 天之前
3 周 4 天之前
3 周 4 天之前
5 周 3 天之前
5 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 4 天之前