Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Or Operator for Macros View modes: 
User avatar
Member
Member
sroot-accessgroup - 5/17/2011 1:51:04 PM
   
Or Operator for Macros
This is probably the most simple question asked in this forum, and I feel silly for even asking, but is there and OR operator that I can use in a macro?

For example, I have a web part on my master page and I want it to display on every page except for a few. My macro of

{%if (cmscontext.currentpageinfo.documentname == "Page Name One") { "false" } else { "true" }%}

for multiple pages, but it doesn't work. Do I need to use nested macros or is there some really simple instruction that I just can't find in the documentation or on Google?

Thanks


User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 5/18/2011 1:38:41 AM
   
RE:Or Operator for Macros
Hello,

you don't have to feel silly at all, because it's actually quite common question and such functionality would be definitely useful, regrettably the context macros don't support the OR and AND conjunctions. You would need to create a custom macro for this purpose which will have this condition inside: Appendix A - Macro expressions.

Best regards
Ondrej Vasil