The closest I came was:
1. Changing event to 'OnWebPagePrerender'
2. Using $modx->resource->_output:
However, tags inside the output are not rendered.
[ed. note: moddereks last edited this post 14 years, 8 months ago.]
-
MODX Staff
- 10,725 Posts
There is not necessarily an equivalent. The $modx->resource->_content contains the cacheable content (after processing of cacheable tags) and $modx->resource->_output the non-cacheable output (after processing of non-cacheable tags).
-
MODX Staff
- 10,725 Posts
This will not change the Template, just replace content in the content field. What are you trying to do?
I am trying to modify the plugin (referenced in my original post) that basically replaces template contents with contents of a given file. I could use static resources but I want to make this sucker work. In the template I'd like to specify: "@LOAD some/template/file.tpl" and then have the plugin load the content of that file. The PHP code is simple but I can't figure out how to replace the template contents. It keeps showing ""@LOAD some/template/file.tpl" when I reload the site.
-
MODX Staff
- 10,725 Posts
Why don't you just make the Template a Snippet? Or use 2.2 and use Static Elements? I'm not sure why you want to dynamically replace the content of the Template on the fly via a Plugin. You would need to replace the Template content, but I don't think that is possible via plugin in Revo at this time.