Hi
I want to create a user macro which will validate whether last modified date is greater than given timeframe.
If current date - last modified date >= 30 days, need to populate a waring message saying "The page needs to be reviewed as It was last modified 30 days ago"
Also, I want to set this day (30 days) to be dynamic. User should able to set their own timeframe when they adding the macro to their page.
Is it possible to have such a user macro that accept dynamic parameter? Can someone pls help?
This is not quite what user macros do, they don't "validate" or process things, they run when a page is rendered.
Now, that does not mean you can't get them to do things (you could write a macro that updates a counter somewhere every time a page is viewed for example, or trigger a script or javascript if they rendered a clickable button) but mostly they are used for rendering things, not doing things. Rendering stuff is a lot easier than making them process things (and quite often people don't get that processing stuff on view is usually a bad idea as it can end up being done way too many times!)
So, I want to redefine your macro a little bit, and check that my definition would do what you want. Given that your people would use the macro with something simple like
{update-needed: parameter X}
Then when the macro is added to a page, when rendered, it will do something like:
Would that be the right behaviour?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.