On Fri, 2009-05-01 at 16:40 +0200, Thomas Waldmann wrote: > > I am writing a macro which needs some arguments. I wonder if it is > > possible to detect if the page is being previewed? > > I would display error message in preview mode, but silently ignore > > errors when the page is viewed by a regular user? > > Interesting idea, but after thinking about it, I don't think one really > wants that. An error should show as long as until it is fixed. Otherwise > some not carefully looking (or not previewing at all) editor will > introduce errors and noone will see and fix them.
That would have been useful, for the situation where the macro can degrade properly (i.e ignore the value and/or provide a reasonable default). For example, my macro builds a sidebar with some standard user information in Debian http://wiki-debian-net.klabs.be/User/JohnDoe source is: http://wiki-debian-net.klabs.be/-plugin/macro/DebianPortfolio.py The macro accepts a lot of optional parameters. Actually I have implemented a built-in help, that can be displayed with: <<DebianPortfolio(showhelp=yes)>> see the bottom of http://wiki-debian-net.klabs.be/DebianPortfolioMacro So for example: * All fields are optional. Still I would print the help when all the fields are empty. * The email is important, but not compulsory. * I might want to add some other important fields later... And warn the user when he/she edits the page, but not visitors. Regards, Franklin ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ Moin-user mailing list Moin-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/moin-user