Is it possible to use some if statements direct in the template file? I know normally I should create a macro but this is not possible in this situation because otherwise i have to create five different macros.
Just want to check if a true/false property is checked an generate some html code
I've used this in the past for templates: (outputting different macros based on a test)
<% if (Request.RawUrl.IndexOf("thank-you", 0) == -1) {%> <!-- INCLUDE TRACKING ON ALL PAGES EXCEPT THANK YOU PAGES --> <umbraco:Macro Alias="SearchForceTracking" runat="server"></umbraco:Macro> <% } else {%> <!-- INCLUDE ON THANK YOU PAGES --> <umbraco:Macro Alias="SearchForceConversion" runat="server"></umbraco:Macro> <%}%>
if statement in template file
Hi guys,
Is it possible to use some if statements direct in the template file? I know normally I should create a macro but this is not possible in this situation because otherwise i have to create five different macros.
Just want to check if a true/false property is checked an generate some html code
Thanks
I've used this in the past for templates: (outputting different macros based on a test)
-Craig
but how can i ask for a property instead of RawUrL
Just if property = true then...
Hi dominik,
This thread has a solution: http://our.umbraco.org/forum/templating/templates-and-document-types/15707-if-statement-on-masterpage?p=0#comment57895
-Tom
is working on a reply...