[development] Node Rendering Debate

Larry Garfield larry at garfieldtech.com
Fri Jun 22 00:29:22 UTC 2007


On Thursday 21 June 2007, adrian rossouw wrote:
> On 21 Jun 2007, at 9:25 PM, Earl Miles wrote:
> > [assuming I've set the CCK field 'myfield' to show up in the
> > $my_field variable in the theoretical UI that will exist for this]
>
> I'm against requiring a UI to do anything of the sort. It should just
> happen.
>
> The variable shouldn't sometime be called one thing, and sometime
> called something else.

Let me give a few real world examples of what my themers keep asking my help 
to do.  

node 5, of type foo, has a multi-value cck field called bar and another baz, 
and non-multi-value cck fields gah and ugh.  It also has a value that's been 
added to the node directly by some custom module that we also want.

"I want fields bar, baz, baz, and baz to show in a table.  If they're 
multi-value, then bar should be comma-separted but baz should be <br /> 
delimited, and oh yeah any of those could have no value in which case that 
row shouldn't appear."

What I do now is tell them to go away while I do muck about with arrays, 
implode, and theme('table') inside a phptemplate_ function and then feed them 
a single final variable into the template that they can't control.  They can 
handle "just use $node->content['foo'][0] and go away" just fine.  I don't 
think they'd care between that and "just use show('foo', 0) and go away".  
Anything more complex than that always gets given to me anyway.

Nothing against my themers, mind you.  They're all smart cookies and very good 
at what they do, but I just had to talk one of them through the l() function 
today.  (Yes, we had one in a template file.  It was necessary.)  

I really wonder what the use case for any of these complex template file 
setups is, when even a multi-value CCK text field scares them away because 
they'd have to use implode() (what's that?).

If you (collectively) can give me a way to let my themers do that sort of 
setup without actually having me do it instead, I'll sit up and take notice.  
Otherwise, I really don't see what we're accomplishing.

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the development mailing list