Macros in widgets

Craig Wyatt asked on July 12, 2016 21:54

I am having trouble getting a macro to work in a widget. Am I missing something?

Recent Answers


Trevor Fayas answered on July 12, 2016 21:58

Can you be a little more specific?

If you're trying to use macros in the Widget properties, make sure to hit the black > icon to the left of the edit field to turn it into a "macro" input.

0 votesVote for this answer Mark as a Correct answer

Craig Wyatt answered on July 12, 2016 22:09 (last edited on December 10, 2019 02:30)

I have a wdiget based on a repeater. the macro i have is in side the where condition NodeAliasPath like '/{%x=CurrentDocument.NodeAliasPath.Split("/")[1];return x|(handlesqlinjection)true|(identity)GlobalAdministrator%}/Sliders/%' or NodeAliasPath like '/Global-items/sliders/%' it renders when I place it on the page, but does not in the widget.

1 votesVote for this answer Mark as a Correct answer

Craig Wyatt answered on July 12, 2016 22:11

It seems I am able to make it work if I make it part of the default widget properties and not editable by the page editor.

0 votesVote for this answer Mark as a Correct answer

Laura Frese answered on July 12, 2016 22:18 (last edited on July 12, 2016 22:28)

Macros dont work in widgets, you will have to create another template and use a web part. Or, like you said, make it part of the default widget properties.

1 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on July 12, 2016 23:36

Now I get ya, yeah Laura is correct, you can't natively put macros in widget properties the use enters, you would have to either adjust the web part code to render the text through the current macro resolver, or give the use a separate field and then in the default widget property settings put a macro that references that separate field.

0 votesVote for this answer Mark as a Correct answer

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