I have below code in head html code webpart
{% var image=""; if(condition){image="X";}else{image="Y";} %}
{% if(image != null) <meta content={% kenticofunction(image) %} > %}
Above meta tag is not displayed in html output. Not sure whether macros I wrote is in correct format or something fails
I would recommend using the macro debug to see what are the resolved values and also check Event log for any errors.
you are doing macro inside macro, but incorectly.. kenticofunction must be a macro method. Try this:
{% if(image != null) ("<meta content="+ MacroMethod(image)+ ">")%}
Peter, That does not work. I see below error in event log
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Anyhow I resolved using Custom Macro Method
Please, sign in to be able to submit a new answer.