You haven't said otherwise so i'm going to assume your using MG3. In which
case the best way to do this is with EvenTypes -
http://trac.model-glue.com/wiki/HowTos/HowToUseTypedEvents

<http://trac.model-glue.com/wiki/HowTos/HowToUseTypedEvents>Create an
event-type which includes all your template elements and then apply that
event-type to your event (or as the defaultType for an event-handlers block)

<modelglue>
    <controllers>
        <!-- controllers are defined here -->
    </controllers>
    <event-types>
        <event-type name="TemplatedEvent">
            <before>

            </before>

            <after>

                <views>

                    <include name="header" template="/path/to/header.cfm" />

                    <include name="left_nav" template="/path/to/left_nav.cfm" />

                    <include name="right_nav"
template="/path/to/right_nav.cfm" />

                    <include name="footer" template="/path/to/footer.cfm" />

                    <include name="main" template="/path/to/main.cfm" />

</views>

            </after>

</event-type> </event-types> <event-handlers>

        <event-handler name="home.page" type="TemplatedEvent">
            <broadcasts>
                <message name="NeedSomeReport" />
            </broadcasts>
            <views>
                <include name="center_content" value="/path/to/whatever.cfm" />
            </views>
        </event-handler>

</event-handlers> </modelglue>


then in main.cfm use
<cfoutput>#event.getView("header")#</cfoutput>
to get each of the template fragments, including center_content and place
them in your layout.

Hope that helps
Chris

2009/12/14 Jeremy Rottman <[email protected]>

> I have a rather simple issue that I would normally just solve with
> using different include files. How ever I am looking for a better way
> to handle this using model glue.
>
> In my application I have 5 different files that I use to build the
> layout for the application:
>
> header
> left_nav
> right_nav
> footer
> center_content
>
> What I am trying to figure out is how do I setup model glue so that
> the first 4 items are always included, in the right order so that all
> I ever really need to worry about is the center_content file. Can
> model glue handle this? or is this something that I should do another
> way?
>
> --
> 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
>

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