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

View: New views
2 Messages — Rating Filter:   Alert me  

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

by hussayn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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: [dev-unsubscribe@...].

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

by Johannes Höchstädter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

for me overwriting an already existing template, by copying it into the
folder for extensions is already possible. What was/is the main goal here?

cheers

Hussayn Dabbous schrieb:

> 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: [dev-unsubscribe@...].
>
>  

--

Johannes Höchstädter

memoComp Software Engineering & Consulting
Frank Freund
Michelsberg 28
65183 Wiesbaden
Germany
Fon +49 (0)611 9320054
Fax +49 (0)611 9320059
Amtsgericht Wiesbaden HRA 4304

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

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@...].