On Jun 6, 2011, at 8:32 PM, Tim Griffin wrote:

> Hi all;
> 
> I'm recrafting this post from an earlier one I deleted to better define a 
> question. I have hit the "mixed parameter tags and non-parameter tags" error 
> and am not sure how to get around it. 
> 
> I defined a custom tag that calls the core Hobo <collection> tag within it. 
> As we all know, <empty-message> is a parameter tag within <collection>. But, 
> I can't seem to call the parameter tag without triggering the mixed parameter 
> error. So, how do I pass the parameter that <collection> is actually 
> expecting?? 
> 
> Any expert opinions out there?
> 
> <def tag="amalgamations-collection" attrs="forprint">
>   <collection>
>     <if test="&forprint">
>       <card class="amalgamation">
>         <strong><view:name/></strong>
>         <br/><view:date_amalgamated/>
>       </card>
>     </if>
>     <else>
>       <card class="amalgamation">
>         <h4><name/></h4>
>         <b>Amalgamated on:&nbsp;&nbsp;</b><view:date_amalgamated_formatted/>
>       </card>
>     </else>   
>     
>     <empty-message:><t 
> key="amalgamation.collection.empty_message"/></empty-message:>
>     
>   </collection>
> </def>
> 
> The above tag only works if I remove the <empty-message> tag. If the 
> <empty-message> tag is left in, I get the "mixed parameter tags and 
> non-parameter tags" error.

Here's the 1.0 definition of <collection>:

<def tag="collection">
  <ul class="collection #{collection_name :dasherize => true}" merge-attrs 
unless="empty?">
    <li param="item" class="#{scope.even_odd} #{model_id_class}" 
repeat="&select_viewable">
      <do param="default"><card param/></do>
    </li>
  </ul>
  <empty-collection-message param="empty-message"/>
</def>


The issue here is that the content "inside" the tag is really just a shortcut 
for what ends up in the param named "default". You should be able to address 
the contents of the <li>  tag with <item:>, which will successfully mix with 
empty-message.

--Matt Jones

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