Hi Garence,

>From your XML config, it appears that templates/website.cfm is your
layout "container", correct? If so, then you should be able to resolve
this issue by creating an event handler for the template view, and
calling it via a result in your event-type, like so:

<!-- New event-handler for layout template. -->
<event-handler name="template.website">
        <views>
                <include name="website" template="templates/website.cfm" />
        </views>
</event-handler>

Remove the corresponding <include> from the <after> block of the
event-type, and add a result instead:

<results>
        <result do="template.website" />
</results>

This will ensure that the "website" view is processed last so it can
assemble the other views from the viewCollection.

HTH,

--
Ezra


On Thu, Aug 20, 2009 at 6:32 AM,
garence<[email protected]> wrote:
>
> I have run into a problem with using an event type that leverages a
> result to display a view.
>
> I have a default event type that checks one's login status and, based
> on that result, either displays a link to login ("website.loginlink")
> or a personalized greeting ("website.salutation"). It looks like
> this ...
>
> <event-type name="website.defaultevent">
>        <before>
>                <broadcasts>
>                        <message name="auth.checkLoginStatus" />
>                </broadcasts>
>                <results>
>                        <result name="isLoggedIn" do="website.salutation" />
>                        <result name="notLoggedIn" do="website.loginlink" />
>                </results>
>        </before>
>        <after>
>        <views>
>            <include name="title" template="pages/title.cfm" />
>            <include name="banner" template="pages/banner.cfm">
>                <value name="xe.home" value="website.home" />
>                <value name="xe.childcare" value="website.childcare" /
>>
>            </include>
>            <include name="navbar" template="pages/navbar.cfm">
>                <value name="xe.home" value="website.home" />
>                <value name="xe.ourstaff" value="website.ourstaff" />
>                <value name="xe.ourphilosophy"
> value="website.ourphilosophy" />
>            </include>
>            <include name="navbar2" template="pages/navbar2.cfm">
>                <value name="xe.blog" value="blog.home" />
>                <value name="xe.lunchmenu" value="website.lunchmenu" /
>>
>                <value name="xe.calendar" value="website.calendar" />
>                <value name="xe.directory" value="website.directory" /
>>
>            </include>
>            <include name="website" template="templates/website.cfm" /
>>
>        </views>
>        </after>
> </event-type>
>
> The event handlers noted in the results are ...
>
> <event-handler name="website.salutation" type="">
>        <broadcasts>
>                <message name="getSalutation" />
>        </broadcasts>
>        <views>
>                <include name="salutation" template="pages/salutation.cfm">
>                        <value name="xe.logout" value="auth.logout" />
>                </include>
>        </views>
> </event-handler>
>
> <event-handler name="website.loginlink" type="">
>        <views>
>                <include name="salutation" template="pages/loginlink.cfm">
>                        <value name="xe.login" value="website.loginform" />
>                </include>
>        </views>
> </event-handler>
>
> When, as an anonymous site visitor, I run an event (i.e.
> "website.home") that is included in an event handlers block that has a
> default event type equal to "website.defaultevent", only the view from
> the "website.loginlink" event displays in the browser.
>
> <event-handler name="website.home">
>     <views>
>        <include name="body" template="pages/home.cfm">
>            <value name="xe.home" value="website.home" />
>            <value name="xe.didyouknow" value="website.didyouknow" />
>            <value name="xe.referafamily" value="website.refer-a-
> family" />
>            <value name="xe.parenttestimonials"
> value="website.parenttestimonials" />
>            <value name="xe.one2onefaq" value="website.one2onefaq" />
>        </include>
>    </views>
> </event-handler>
>
> If I comment out the results block in the "website.defaultevent" event
> type, reinit the app, and refresh the page, then all other views run
> as expected and display in the browser.
>
> My question ... How do I use a result in an event type to run another
> event that displays a view, and include the view in the called event
> handler?
>
> Or maybe better asked, what is the better way to handle this via MG?
>
> garence
> >
>

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