admin管理员组文章数量:1406177
I'm trying to put a macro in a resource string from the localization module but I'm having problems resolving it.
I also resigned all macros and also tried replacing the hash with an '@' symbol so it wouldn't be checked
var bodyText = MacroResolver.Resolve(ResHelper.GetString("SOS.SocialSharing.Email.Body"));
var test = ResHelper.LocalizeString("{$SOS.SocialSharing.Email.Body$}");
var test2 = MacroResolver.Resolve("{$SOS.SocialSharing.Email.Body$}");
All methods return the same thing:
Hello,
please share this link {% DocumentContext.CurrentDocument.AbsoluteURL |(user)admin|(hash)myhash%} with your friends
My resource string looks like this (the hash gets inserted by kentico)
I'm trying to put a macro in a resource string from the localization module but I'm having problems resolving it.
I also resigned all macros and also tried replacing the hash with an '@' symbol so it wouldn't be checked
var bodyText = MacroResolver.Resolve(ResHelper.GetString("SOS.SocialSharing.Email.Body"));
var test = ResHelper.LocalizeString("{$SOS.SocialSharing.Email.Body$}");
var test2 = MacroResolver.Resolve("{$SOS.SocialSharing.Email.Body$}");
All methods return the same thing:
Hello,
please share this link {% DocumentContext.CurrentDocument.AbsoluteURL |(user)admin|(hash)myhash%} with your friends
My resource string looks like this (the hash gets inserted by kentico)
Share Improve this question asked Mar 6 at 13:26 roryrory 1,4384 gold badges26 silver badges52 bronze badges1 Answer
Reset to default 0Where exactly are you trying to resolve the macro? Is it inside the admin UI or on the live site? If it is on the live site and you are using .NET Core, then you should be following this approach
Otherwise, since Kentico 10 for security reasons, macros are not evaluated/resolved recursively. You can try using the "recursive" macro parameter. If true, the system resolves macro expressions contained in the macro’s result recursively.
本文标签: Kentico 13 How to resolve a macro in a resource stringStack Overflow
版权声明:本文标题:Kentico 13: How to resolve a macro in a resource string - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744973200a2635359.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论