TemplatePreCompile & TemplatePostCompile

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Locked
Sonya

TemplatePreCompile & TemplatePostCompile

Post by Sonya »

I could not find any reference in core CMS Made Simple for the events:
- TemplatePostCompile
- TemplatePreCompile

I have created an UDT with just two lines:

Code: Select all

echo 'event XYZ';
exit; 
to see when these events are sent by CMS Made Simple and have assigned the UDT to the events. However, they seem not to be executed at all. Are they deprecated?
Youpi
New Member
New Member
Posts: 7
Joined: Thu Jan 15, 2009 7:01 pm

Re: TemplatePreCompile & TemplatePostCompile

Post by Youpi »

sorry to dig up this old topic, but it is still relevant to me, on top of the fact that this event is still available in CMS MS.

Does 'TemplatePostCompile' and 'TemplatePreCompile' are really triggered ?

If yes, when ?

- when a user post a template update ?
- the first time a template is processed ?
- each time a templace is processed ?

I did't find by myself, it would help to clarify their usefulness.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: TemplatePreCompile & TemplatePostCompile

Post by calguy1000 »

These events are still triggered each time a template is 'compiled' from smarty code into php code.

It is executed for every page template (3 times.. once for the body, head, and top of the tempalte), for each module template, and for each GCB that is called on a particular page.

Compilation happens each time a template is changed. On a cache-able page, if all you do is change a GCB that is used on that page and hit 'reload' on a page the TemplatePreCompile event would be triggered once just for that GCB, and the TemplatePostCompile event would be triggered once.

Theoretically (and I'd have to double check this functionality) if after that you 'reloaded' a page the event would not trigger at all. Because the templates are already 'compiled'.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “Developers Discussion”