Ticket #359 (closed defect: worksforme)
Event-Type override takes defaultType
| Reported by: | calvinhobbs@… | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 3.0 |
| Version: | 3.0.178 | Severity: | major |
| Keywords: | event-type defaultType | Cc: |
Description
I am new to MG - but am trying to get the event-type syntax straight. What I'm doing seems pretty simple, but the results are not as expected. For simplicity, I have the event-type simply doing 'footer' content for me - as defined as such (defining 2 footer pages - both with value of 'footer'):
<event-types>
<event-type name="templatedPage">
<before>
<views>
<include template="pages/footer.cfm" name="footer"/>
</views>
</before>
</event-type>
<event-type name="templatedPage2">
<before>
<views>
<include template="pages/footer2.cfm" name="footer"/>
</views>
</before>
</event-type>
</event-types>
The below I have an even-handler defined with a defaultType of the first templatedPage (footer)
<event-handlers defaultType="templatedPage">
That works well to get my 'results' template to be populated with the footer variable which I can output as such:
<cfoutput>#viewCollection.getView("body")#</cfoutput>
However, overriding a specific event-handler is NOT displaying the second footer as in:
<event-handler name="page.index" type="templatedPage2"><!-- HERE I AM OVERRIDING THE DEFAULT TYPE -->
<broadcasts /> <results>
<result do="template.main" />
</results> <views>
<include name="body" template="pages/index.cfm" />
</views>
</event-handler>
Instead of the text in my footer being 'This is the Footer2' which is the content in pages/footer2.cfm I get the content from footer.cfm 'This is the Footer'. (I have started/stopped service, reload, init=true etc.)
Also, If i override the event-type on the event-hander as in : <event-handler name="page.index" type=""> (per the event-type documentation) it will also show the 'templatedPage' event-type footer content (instead of what I would expect to be NOTHING populated for the footer variable).
This is from a brand new download of 'ModelGlue?_3.0.final.178.zip' from the site - and am running a prior 3.0 version on another project and am seeing some inconsistencies there as well.
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)