Limiting view permissions for certain fields to administrators doesn't
get you most of what you need?

Your sample code won't work because you can't mix parameter and non-
parameter tags (dryml wouldn't know where to put the non-parameter
tags).

<old-show-page merge>
  <prepend-content-body:>
    <div if="&current_user.administrator?">
       ...
    </div>
  </prepend-content-body:>
  <append-content:>
     ...

Might work for what you're wanting.  Note, you can't use prepend and
append on the same parameter (hence switching to prepending on content-
body).  To do that, you should replace and restore the parameter
within your added content.

On Nov 11, 9:46 am, Peter Ehrlich <[email protected]> wrote:
> So I have this page, with a bunch of stuff on it.  This page has more
> stuff on it if an admin views it, and some of the stuff is modified.
>
> (Don't just immediately say admin subsite...)
>
> The way I'm currently doing this is by having a bunch of conditions
> riddled throughout the page.  The way I would like to do it, is to
> have a section below </show-page> that looks something like this:
>
> <extend tag="show-page">
>   <old-show-page merge>
>     <if test="@current_user.admin?">
>       <my-div:>
>         do stuff
>       </my-div:>
>       <append-content:>
>         Do more stuff
> end
>
> Nice.  DRY.  Debuggable and clear.  Supported?
>
> The only way I can think of getting close is by throwing a bunch of
> extend tag definitions inside of a condition in application.dryml.  No!

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to