by
atisz » Mon Apr 03, 2017 2:09 am
trendoman wrote: The best idea is to debug that line. First, I would simplify it by setting a new variable. Then I would see if the variable gets the correct expected value against sets of known incoming data.
This is what we usually do to solve errors..
Thanks@trendoman! This is another late reply on the topic, as I managed to give it a try only today. My problem is solved only partly, as using the IF statement in another situation as follows:
- Code: Select all
<li>
<a href="template-name.php">MENU OPTION
<cms:if "<cms:pages masterpage='members/template-name.php' custom_field="page_hits=0" show_future_entries='1' count_only='1' />">'0' > <em><cms:pages masterpage='members/template-name.php' custom_field="page_hits=0" count_only='1' /></em>
</cms:if>
</a>
</li>
I got returned nothing for <em>....</em> in case I have no page with page_hits=0, but if I have pages with page_hits=0, then before the <em>....</em> I got displayed the final part of the IF check: '0'> , just like the IF is ending right before it. So I tried to use !='0' , gt '0' to avoid using the greater sign what creates the confusion, but all I get are some errors: ERROR! LOGIC_OP: Invalid char "!" , ERROR! LOGIC_OP: Invalid char "g"
I even tried to use brackets to make the code more clear
- Code: Select all
<cms:if ("<cms:pages masterpage='members/template-name.php' custom_field="page_hits=0" show_future_entries='1' count_only='1' />">'0')>
but all I get is another error message: ERROR! Unclosed bracket in "if".
This is killing me

I'm making some mistakes or what's happening here, because I can't think clear anymore?!