Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The $site variable is made redundant by $site_name, and is not used.
Comment | File | Size | Author |
---|---|---|---|
phptemplate_redundant_var_patch.txt | 815 bytes | robertDouglass |
Comments
Comment #1
robertDouglass CreditAttribution: robertDouglass commentedComment #2
Steven CreditAttribution: Steven commentedBluemarine declares $theme as global, but as far as I can tell it doesn't use it anywhere. I think we can safely remove it?
Comment #3
robertDouglass CreditAttribution: robertDouglass commentedagree. It can be removed.
Comment #4
Dries CreditAttribution: Dries commentedI think it is being used in bluemarine/page.tpl.php:
l(t('edit secondary links'),'admin/themes/settings/' .$theme)
Please double check.
Comment #5
Steven CreditAttribution: Steven commentedThis is not present in the core bluemarine, I removed it.
Comment #6
Steven CreditAttribution: Steven commentedSorry the two issues ($site and $theme) got mixed up. I probably just pasted in the wrong tab :P.
$site is being used by several contrib modules... $site_name only applies to the main name when displayed as a logo. Contrib usages show "Welcome to $site". It's probably a good idea to keep it, no?
Comment #7
robertDouglass CreditAttribution: robertDouglass commentedI still think it is redundant and that the contrib usages should be updated. In fact, the example that you quote is really a bug because it overrides the toggle presented by the theme. $site_name is exactly the same text, but only gets shown if the administrator has toggled it on. It seems to me like PHPTemplate engine should only offer $site_name, and if the theme really *wants* to override the toggle, they can still call variable_get. I think the theme creator in the contrib example was confused by the redundancy.
Comment #8
Steven CreditAttribution: Steven commentedWell, it's not really a bug... it's merely a variable that is available for use. $site_name incorporates the wish to display the site_name as a title in the header. $site is used in alt attributes and whatnot.
Still I got rid of it. Please add a note to the theme upgrading guide about this though.
Comment #9
(not verified) CreditAttribution: commentedComment #10
(not verified) CreditAttribution: commentedComment #11
(not verified) CreditAttribution: commentedComment #12
(not verified) CreditAttribution: commentedComment #13
(not verified) CreditAttribution: commented