This question about Using an extension: Answered

Alternative syntax for deprecated

With version 7.00 of RenderPlugin (released 29 Apr 2022) the prior syntax of using rest call with 'tag' handler was deprecated. I'm wondering if there is some other syntax available with this plugin to fulfills same purpose, specifically to return a simple macro such as VarWIKINAME. I understand that for cases using tag?name=INCLUDE, the ajax call can be reformatted simply as a view url pointing to topic and section with skin set to "text". However, I haven't found an way yet to simply return a simple macro value. I suppose, lacking a more direct option, I could create a topic with a section that simply has the desired macro in it.

-- LynnwoodBrown - 26 Nov 2022

No there isnt an alternative syntax available for the same reasons it has been deprecated in RenderPlugin: tag is a broad attack surface for all sorts of dynamic requests. VarWIKINAME is avalable in javascript using the foswiki.getPreference() api. Do you have a more specific use case other than that?

-- MichaelDaum - 27 Nov 2022

I get your point about the potential danger of the old implementation. Was just interested in being able to make an ajax call to return some basic macros but there's always other ways to achieve same ends with Foswiki. Good point about foswiki.getPreference() as way to get some basic info. Consider this question answered.

-- LynnwoodBrown - 27 Nov 2022

Depending on your needs using HTML5 data attributes are the next best thing propagating information from the server to the client. Though not available in a dynamic fashion of course, this way coverse most of the needs I've come accross so far. Given a more concrete use case we could discuss this here in more detail if you like.

-- MichaelDaum - 28 Nov 2022
 

QuestionForm edit

Subject Using an extension
Extension RenderPlugin
Version Foswiki 2.1.7
Status Answered
Related Topics
Topic revision: r4 - 28 Nov 2022, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy