[development] Node Rendering Debate

sime info at urbits.com
Fri Jun 22 18:03:51 UTC 2007

Here are my thoughts, most of which I'm just stealing from other people 
and mashing together.

I like the earlier idea of show() and hide() functions. The first 
argument of show() is a region name, so page.tpl.php becomes a NO BRAINER!:

   <?php show('head'); ?>
<div id="sidebar-left">
   <?php show('left'); ?>
<div id="content-main">
   <?php show('content'); ?>
<div id="sidebar-right">
   <?php show('right'); ?>
<div id="footer">
   <?php show('footer'); ?>

This is easier than current system, because the order of the various 
components ($picture, $messages, etc) is no longer hard-coded. (Not to 
mention that confusing if/else wrappers around the variables which 
require a themer to understand control structures). And by controlling 
the order of components internally by weight we've subsequently opened 
up the option for module developers to write "theme control modules" 
that define custom order and location of components via the UI.

This is future-proof against new variables, and it's easy, easy, easy 
for theme developers,  while the advanced themer can decide the order 
manually like this:

<div id="content-main">
   <?php show('content', 'messages'); ?>
   <?php hide('content', 'picture'); ?>
   <?php show('content'); // print the remaining ?>


More information about the development mailing list