Closed (fixed)
Project:
Zen
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
11 Sep 2008 at 08:28 UTC
Updated:
2 Nov 2008 at 03:41 UTC
The D6 menu system has built-in support for keeping the code base smaller by only including the code needed for a particular path.
We can do a similar thing for the Zen theme. Only include the code needed for a particular feature if we're actively using that feature.
For example, block editing links are only needed for users with the proper permissions. And the zen_theme() function is only needed when the theme registry is being rebuilt.
I'm taking http://raincitystudios.com/blogs-and-pods/steve-krueger/raincity-studios... seriously. :-)
Comments
Comment #1
johnalbinJust removed 80 lines from the end of template.php by conditionally including the code that is only needed while rebuilding the theme registry or while displaying the theme settings forms.
http://drupal.org/cvs?commit=139333 Moved zen_theme() to template.theme-registry.inc.
http://drupal.org/cvs?commit=139335 Refactored zen_settings_init as zen_theme_get_default_settings and moved to template.theme-registry.inc.
Comment #2
johnalbinRemoved 75 more lines.
http://drupal.org/cvs?commit=139344 Moved some comments from zen to STARTERKIT where they belong.
http://drupal.org/cvs?commit=139347 Moved block editing code to template.block-editing.inc.
http://drupal.org/cvs?commit=139349 Moved zen_preprocess_comment() to template.comment.inc.
Comment #3
johnalbinI also did:
* Optimized zen_breadcrumb()
* Moved some comments from zen to STARTERKIT where they belong
* Folded template-menus.php back into template.php since its not conditionally included
* Removed theme_username from STARTERKIT and zen_classic since it was fixed in Drupal 6.3
* Optimized zen_menu_item_link()
* Optimized path_to_zentheme()
More optimization ahead…
Down to 275 lines in template.php from previous 500 lines in 6.x-1.0-beta2.
Comment #4
johnalbinDown to 251 lines. :-)
Which, I just noticed is 2 lines shorter than the template.php in the Basic theme. ;-)
http://cvs.drupal.org/viewvc.py/drupal/contributions/themes/basic/templa...
Done (for now).
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
Renzy commenteddeleted - apologies