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.
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.
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.