Try this in your app/views/pages/show.dryml:

<show-page>
   <after-header:>
      <if test="&this.content_type == 'image' && !this.content_link.empty?">
         <image src="&this.content_link"/>
      </if>
    </after-header:>
</show-page>

Bryan

On Tue, Feb 28, 2012 at 9:16 AM, Scorpio <[email protected]> wrote:
> Hello. I've tried everything I can think of to extend this code :
>
> <def tag="show-page" for="Page">
>  <page merge title="#{ht 'page.show.title', :default=>['Page'], :name
> => name(:no_wrapper => true) }">
>
>    <body: class="show-page page" param/>
>
>    <content: param>
>          <header param="content-header">
>            <a:chapters param="parent-link">&laquo; <ht
> key="page.actions.back_to_parent" parent="Chapter" name="&this">Back
> to <name/></ht></a:chapters>
>            <h2 param="heading">
>              <ht key="page.show.heading" name="#{name(:no_wrapper =>
> true)}">
>                Page <name/>
>              </ht>
>            </h2>
>
>            <record-flags fields="" param/>
>
>            <a:owner param="creator-link"/>
>
>            <a action="edit" if="&can_edit?" param="edit-link">
>              <ht key="page.actions.edit" name="#{name(:no_wrapper =>
> true)}">
>                Edit Page
>              </ht>
>            </a>
>          </header>
>
>          <section param="content-body">
>            <view:body param="description" />
>            <field-list fields="index, content_link, content_type"
> param/>
>            <section param="collection-section">
>              <h3 param="collection-heading">
>                <ht key="chapter.collection.heading"
> count="&this.chapters.count" >
>                  <human-collection-name collection="chapters" your/>
>                </ht>
>              </h3>
>
>              <collection:chapters param/>
>            </section>
>          </section>
>    </content:>
>
>  </page>
> </def>
>
> What I want to do Is add this code (or it's dryml equivalent):
>
>            <%if this.content_type == "Image" and this.content_link%>
>            <%= image_tag(this.content_link) %>
>            <%else%>
>            <%end%>
>
> to the top of the body below the header but everything i try seems to
> either replace content in total or do nothing despite the old and
> merge keywords. Also the back to chapter link doesn't work. I've got
> no idea why as the link looks ok to me. I know I'm asking a lot but I
> wanna use that as reference for the future as I've been struggling to
> understand dryml since 1.0
>
>
> [Sorry for lack of dryml but I try to minimize it's use as I've got no
> idea how this works despite a *LONG* time of effort. btw something
> explaining it on a practical example would be nice as the reference
> didn't help me much as half the tax are either absent or out of
> context so it really tells me very little to nothing]
>
> I can get the desired result the way I've been always working that is
> copying the tag to application.dryml and overwriting it from there but
> I wanna do it clean for once. Again. I've got no idea how to extend
> that even more in show.dryml as it says something that param is
> unavailable outside of a definition :(
>
> Please help.
> Thanks in advance.
>
> --
> 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.
>

-- 
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