The idea is that the macro CheckSecurity will make some tests, and stop the rendering if some conditions are false (not allowed alttemplate, for example). Then the two following macros should be executed.
How about setting some kind of application variable (cache, session, ...) in the first macro and check for that in the other macros, if condition false then don't do anything in the macros? Haven't tried yet to end the response this way yet, however might actually be a bit tricky this way as you don't always have a clean state/linear workflow (e.g. multi threading).
But, I was planning to use this to prevent using a wrong alttemplate on every document. If I want to apply your solutionn I have to add this check in every macro.
I was planning to add this check only as the first macro of the upper master template.
Stopping page rendering
Hi,
I would like to stop the rendering of a page after a test. Something like :
in the template
The idea is that the macro CheckSecurity will make some tests, and stop the rendering if some conditions are false (not allowed alttemplate, for example). Then the two following macros should be executed.
I plan to use something like:
and an xslt extension like :
But I end up with an error
Thread was being aborted.
at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements)
at umbraco.macro.renderMacro(Hashtable attributes, Hashtable pageElements, Int32 pageId)
at umbraco.presentation.templateControls.Macro.CreateChildControls().
Has anyone done something like this in the past?
I'm still on V4.0.3.
Thanks
How about setting some kind of application variable (cache, session, ...) in the first macro and check for that in the other macros, if condition false then don't do anything in the macros? Haven't tried yet to end the response this way yet, however might actually be a bit tricky this way as you don't always have a clean state/linear workflow (e.g. multi threading).
Cheers,
Sascha
Thanks a lot for this response.
But, I was planning to use this to prevent using a wrong alttemplate on every document. If I want to apply your solutionn I have to add this check in every macro.
I was planning to add this check only as the first macro of the upper master template.
is working on a reply...