We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Hi Everyone,

    I’ve add two new OnParseDocument and OnLoadWebDocument events. The OnParseDocument event will be very useful for users wanting to add more power to their pages. Check this out:

    This plugin will replace ever instance of "@w" with "WOW!" and every instance of "@c" with "COOL!".

    $source = &$modx->documentOutput;
    $source = str_replace('@w','WOW!',$source);
    $source = str_replace('@c','COOL!',$source);


    Now if we add the text "@w This is @c" to a document the parser will then convert it to "WOW! This is COOL!"

    Note here that you can referenc the document source by using the &$modx->documentOutput variable.
      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 25663 MODX Staff
      • 12,272 Posts
      That’s definitely handy. Particularly for custom web applications. Cool stuff!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 33337
        • 3,975 Posts
        Cool feature,

        but it reminds me BBCode laugh, ...

        looking forward to other members input !

        regards,

        zi
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 1764
          • 680 Posts
          Very nice. This work great great for frontend editing.

          There are a couple of other uses that come to mind too. I’ve been thinkning for a while that we need an auto-linking module that automatically creates hyperlinks out of certain keywords, I also want to work on a resized image caching plugin to automatically resize and cache images at their output size. This should work nicely for both of those.

          - Adam
            • 32963
            • 1,732 Posts
            Yes, it’s all possible now with the new events. The OnLoadWebDocument event is very useful for those wanting to redirect users to another page based on browser type etc, or change a template or theme.
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.