Render Macro
Used for ajax calls equivalent to old tag handler

10 August 2023 - 16:32 | Version 2 |

Documentation

This function is designed to restore the functionality of the "tag" parameter in RenderPlugin that was deprecated.

Here's an example of the old format (used in ajax call):
%SCRIPTURLPATH{"rest"}%/RenderPlugin/tag?name=INCLUDE;param=Applications.RenderWebTagCloud;search=screenshot

…and here's how that same call would be defined using this topic:
%SCRIPTURL{"view"}%/Applications/DocumentationApp/RenderMacro?expand=true;cover=include;skin=text;section=render;macro=INCLUDE;default=Applications.RenderWebTagCloud;search=screenshot

Parameters
All passed as url params
  • macro - required - macro name to be expanded

Implementation

%STARTSECTION{"render"}%%INCLUDE{"%WEB%.%TOPIC%"
   section="expand"
   TARGMACRO="%URLPARAM{"macro"}%"
   PARAMLIST="%FORMATLIST{"%QUERYSTRING%" 
            split=";" 
            pattern="(.*?)=(.*)" 
            exclude="(skin|cover|expand|section|macro)=.*" 
            format="$1" 
            separator="-"
         }%"
   PARAMS="%FORMATLIST{"%QUERYSTRING%" 
            split=";" 
            pattern="(.*?)=(.*)" 
            exclude="(skin|cover|expand|section|macro)=.*" 
            format="$percntIF{\"'$1'='default'\" then=\"$percntIF{\"$hits > 1\" then=\"\\\\"\"}$percnt$percntURLPARAM{$1}$percnt$percntIF{\"$hits > 1\" then=\"\\\\"\"}$percnt\" else=\"$1=\\\"$percntDECODE{\"$2\"}$percnt\\\"\"}$percnt" 
            separator=" "
          }%"
}%%ENDSECTION{"render"}%

%STARTSECTION{"expand"}%%IF{"'%PARAMLIST%'=''" 
   then="$percnt$percntTARGMACRO$percnt$percnt" 
   else="$percnt$percntTARGMACRO$percnt{$percntPARAMS$percnt}$percnt"
}%%ENDSECTION{"expand"}%

Test




Copyright

© 2015 Your Name

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Middle Fork Home Wiki? Send feedback
Syndicate this site RSS