I’ve never used plugins to set place holders but I believe that by the time the OnWebPagePrerender event is triggered all place holders will have been cleaned up.
Try using a different event (onWebPageInit or onParseDocument) or create a place holder which is not recognized by MODx and replace that in your plugin.
I don’t know what you’re trying to do but perhaps there’s a different way of achieving it besides a plugin?
Thanks for the answer.. i had tried with this event onWebPageInit or onParseDocument, but it continues to not work.
I am tring to include a statistics application.. the plugin is a php include, the application logs the visit and sometime (the first time the user visist the site) add a <script> tag
The <script> tag must be added in a precise position of the page
How can i do in different way or let’s work this way?
Thanks!
Try turning off the page’s caching. ( Edit Document >>Page Settings >> Cacheable = no)
You can also enable visitor tracking in the MODx configuration and try the OnLogPageHit event.
thanks for the answer
in this time i had done some tests
And i had set OnWebPageInit
It doesn’t work above all because i coded
$modx->setPlaceholder(placeholdername,$output);
whitout ’ ’
now it is $modx->setPlaceholder(’placeholdername’,$output);
And work great..
I didn’t know about OnLogPageHit.. i will try next time..
Thanks!!