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

    I want to choice in my plugin, which document will be rendered and I want to ask you which System event is the best for this.

    And second how can I tell(pass to) the document parser which document have to render.

    Or exist some plugin for this. I didn’t find any, but I didn’t find deeply, tommorow i will finding more minutely.

    Thank you for suggestions.
      • 3749
      • 24,544 Posts
      Quote from: snop at Dec 20, 2008, 04:42 PM

      Hi,

      I want to choice in my plugin, which document will be rendered and I want to ask you which System event is the best for this.

      And second how can I tell(pass to) the document parser which document have to render.

      Or exist some plugin for this. I didn’t find any, but I didn’t find deeply, tommorow i will finding more minutely.

      Thank you for suggestions.

      I’m not sure a plugin is the way to go here. Most of the front-end system events you could use assume that a particular document has been selected for display, so it doesn’t really make sense to have your plugin then select a different document. I think that OnLoadWebDocument would be the earliest you could grab onto and it fires *after* the document (which you might not want to display) has been loaded from the DB. Maybe someone else can give a better answer.

      Maybe if you explain what you’re trying to do and why, people could suggest other ways to do it.

        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
        • 27843
        • 170 Posts
        Hi

        Quote from: BobRay at Dec 20, 2008, 10:35 PM


        I’m not sure a plugin is the way to go here. Most of the front-end system events you could use assume that a particular document has been selected for display, so it doesn’t really make sense to have your plugin then select a different document. I think that OnLoadWebDocument would be the earliest you could grab onto and it fires *after* the document (which you might not want to display) has been loaded from the DB. Maybe someone else can give a better answer.

        Maybe if you explain what you’re trying to do and why, people could suggest other ways to do it.

        Ok, so I try describe what I want. I have site where the sites are showed up throught Ajax, but in the adress bar is still the ssame address and when I press F5(reload site), is showed up this site.

        I want to do this, in every ajax request (which showing up site) I save id of this site to the session and hyper link will set up anchor with this id, so <a href="xx#id" and when I reload the site i will check the uri and on the basis of the anchor I set up, which site will render document parser.
          • 3749
          • 24,544 Posts
          Sorry, still not sure what you’re trying to do.

          If you have the id saved to a $_SESSION variable, maybe you could insert a snippet on the page that reads that $_SESSION variable and outputs the "<a href .. " tag you want using $modx->makeUrl() to create the url.

          Or you could use $modx->sendRedirect() in the snippet to actually send the user to the new page.

          Maybe others will have a better idea.


            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