We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36425
    • 49 Posts
    Hello!
    Prompt please function, with which I can change the template in the plugin, and on what event?

    I need to change certain events website template, not from the administration panel, namely, the php-script.

    is it real?
    thanks for advance
      • 3749
      • 24,544 Posts
      I think you want one of these. I'm not sure which:

      OnHandleRequest — Fires when any request for a resource is received in the front end.

      OnWebPageInit — Fires after determination that the site is online and the requested resource is located.

      OnLoadWebDocument — Fires after the requested resource is loaded, but before it is parsed.

      OnParseDocument — Fires just before the MODX tags are processed.

      And one of the following (again -- not sure which, but I think it's the first one) to test them:

      <?php
      $modx->resource->set('template', 12);


      <?php
      $resource->set('template', 12);
      
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36425
        • 49 Posts
        thanks for help, it's work OnLoadWebDocument.