I would do this in the model, outside of the realm of Model-Glue altogether.
 The getCategories message would place your array of category objects into
the event, much as you are describing, and then the categories themselves
would be able to get their associated articles.  So your view would only
need to grab the array of categories from the event, and then, while looping
through the categories, would ask each category for its articles.


On Thu, Dec 17, 2009 at 1:29 PM, Jeremy Rottman <[email protected]> wrote:

> I have an event called getCategories that returns me an array of
> records. Pretty standard stuff.
>
> Now with in my display code I have the following block of code. Inside
> this loop I need to call another event called getArticleByCategory,
> but I am not sure how to call this event. I have read through the
> event api and I do not see how one can call an event from with inside
> a loop.
>
> Any information you can give me is greatly appreciated.
>
>                <cfloop array="#articleCategories#" index="j">
>                        <div id="more-articles-header1"
> style="background-image:url
> (#j.getCategoryColorImageURL()#);">
>                                 &nbsp;
>                                <div class="success-articles-header-text">
>                                         #j.getCategoryDescription()#
>                                </div>
>                                <div class="success-articles-view-all">
>                                        <a href="">VIEW ALL >></a>
>                                </div>
>                        </div>
>                        <br />
>                        <div class="more-articles-content">
>                                <div class="success-stories-articles-image">
>                                        <img src="" width="100" height="78"
> />
>                                </div>
>                                <div class="success-stories-articles-text">
>                                        <h1>Title</h1>
>                                         <a href="">Read More...</a>
>                                </div>
>                                <div class="more-articles-footer">
>                                        <a href=""><span
> class="related-articles">Related Articles</
> span></a>
>                                </div>
>                        </div>
>                </cfloop>
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en




-- 
Bob Silverberg
www.silverwareconsulting.com

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" 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/model-glue?hl=en

Reply via email to