0

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>
{{else}}
<p> no </p>

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

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

1 Answer 1

2

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"}}
2
  • 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
    – Brian N
    Commented Aug 8, 2019 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. Commented Aug 9, 2019 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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