Resolving Macro's in page type fields

Brett Stockley asked on March 27, 2019 23:56

If you have a page type and you create a custom field which is rendering the CKEditor with macro button you can add Macro's here.

In the transformation for the page type in text/XML mode we have tried a few solutions around macro resolver and others to render the macros in here. Using rich text editor and putting the macro's in source mode does not seem to have any result.

{% MYFIELD %} out of the box does not work and a few variations of MacroResolver did not seem to output anythig. What is the correct way to ensure you render any macro that may exist in your custom field?

Thanks

Correct Answer

Juraj Ondrus answered on March 28, 2019 08:06

The recursive macro evaluation is disabled by default due to security reasons. If you want to resolve macros inside macro, you need to use e.g. the recursive parameter with the parent macro or, something like this: {%ResolveMacros(FieldName)%}

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brett Stockley answered on March 28, 2019 23:52

That worked, thank you. We were trying things like CMS.MacroEngine.MacroResolver.Resolve.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.