I want use if else like this code but it not working. Please help me

{{if config path="system/config/path" == 1}}
<p> ok </p>
<p> no </p>

I create it in home page, menu->cms->page

  • what it is showing on front ? – Pawan Aug 8 '19 at 5:14
  • try remove space in "if config" use "ifconfig" instead. It's just a guess, I am not sure on this – Shoaib Munir Aug 8 '19 at 5:25

It would be fine if you create phtml file and call that particular phtml file in the CMS block.

for eg. Your CMS block

{{block type="core/template" template="page/html/condition.phtml"}}
  • hi Sunny Rahevar, i tryed, but it not working. i created home.phtml in app/design/frontend/hemmen2/default/template/page/html/home.phtml and add {{block type="core/template" template="page/html/home.phtml"}} in cms but it not show – TN98 Aug 8 '19 at 12:21
  • Can you please first print hello in the phtml file instead of your code? if 'hello' display in the front-end that means your file called correctly and there is something issue regarding in your code in the phtml file. – Sunny Rahevar Aug 9 '19 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.