Poor mans Scarab-views are easy to achieve ...

Hussayn Dabbous <[email protected]> Wed, 10 Jun 2009 11:03:30 +0200
Newsgroups gmane.comp.java.scarab.devel
Message-ID <[email protected]>
Hi;

i found 34 calls to renderer within the entire Scarab template directory 
structure.
I have the idea to encapsulate the call into a macro:

#macro (render $path $template)
    $renderer.render( $path, $template)
#end

and refer to that macro instead of the direct call to the renderer.

Then i can put some logic into the macro, which examines the PathInfo for
the occurance of /view/<myview> and if the parameter is found:

check if the template /views/$view/$path/$template exists.

If the template exist:

$renderer.render( /views/$view/$path, $template)

else

$renderer.render( $path, $template )

Then i can drop a modified stripped down copy of the templates into my
userextensions section and i have views. Of course it would be nice to
be able to control views in a more elaborate way, but that could be
added later, if the concept itself proofs reliable and usefull.

Any complains about implementing the initial organisational change of 
adding the
#render macro to the templates ? It would not change any functionality 
of Scarab.

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=455&dsMessageId=2360847

To unsubscribe from this discussion, e-mail: [[email protected]].