-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jim,

First question is very interesting: parameter tags + ifs are not very
good friends. There must be certainly a better way to do it, but this is
the workaround I usually use in show.dryml:

<%
custom_list = "client, location, ..."
custom_list += ", status" if @record.status == 'draft'
%>

<show-page>
  <field-list fields="&custom_list"/>
</show-page>



I think the answer to the second question lies in the context. Try
something like this:

<show-page>
  <field-list: fields="...">
    <append-status-view:>
      <transition-buttons with="&this_parent"/>
    </append-status-view:>
  </field-list:>
</show-page>

When you are inside the view of "status", the context is the status of
the record, and not the record. The "transition-buttons" tag needs the
record to work.

So in order to do that you can use this magic spell:

  with="&this_parent"

this_parent makes you go up the ladder to the parent context. It's
really useful!

Regards,
Ignacio



El 25/08/11 22:49, Jim Harvey escribió:
> Ignacio, thank you! That was very helpful. I believe I have it working
> now. However, I still have some confusion with DRYML when trying to
> customize my show page.
> 
> 1. I do not want to show the status as part of the field-list if the
> record is 'published'. I have tried the following:
> 
> <% if status == draft %>
>   <field-list: fields="status, ...">
> ...
> <% else %>
>   <field-list: fields="...">
> 
> as well as the DRYML tag and attribute versions of "if". In all cases,
> I get an error such as:
> 
>   "mixed parameter tags and non-parameter tags (did you forget a
> ':'?)"
> 
> 
> 2. Also, why is it that I can include transition-buttons outside of
> the field-list but not inside the table such as:
> 
> <field-list: fields="status, ...">
>   <append-status-view:>
>     <transition-buttons />
>   </append-status-view:>
> </field-list:>
> 
> This gives me an error such as:
> 
>   "undefined method `lifecycle' for
> "published":Eteachable::LifecycleStateField"
> 
> 
> If anyone can provide any insight into why these errors occur, I would
> be very grateful. Still learning how DRYML works, clearly. Thank you!
> 

- -- 
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5XOPYACgkQBPlUJ6RHaOTXdQCg8ebrH1JNW34jsWKxWyDmFWKP
CEkAoJd4INeumPKJzZoj1hC9mAYud9zw
=uVFg
-----END PGP SIGNATURE-----

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