0

I want to show two different contents of a cms page (e.g. about us) in two different themes.
I know it can be possible if I create a template where I can have the theme specific condition and include the template in the cms page as

{{block type="core/template" template="path/to/template.phtml"}} 

But I want the contents for both the theme should be handled in the admin cms page content section.
So is it possible to apply condition for themes using {{if}} syntax in the cms page content section?

I tried to write a simple {{if}} statement for testing but it just printed it in the frontend.

So could anyone suggest what is correct method of writing these statements ?

Rohit Kundale
3,3921 gold badge22 silver badges28 bronze badges
asked Feb 22, 2016 at 6:49

2 Answers 2

0

{{if}} {{else}} {{depend}} are conditional macros for use in transactional email templates. They are not used in constructing CMS pages.

For more information on conditional use in transactional emails

Common CMS Macros AKA ShortCodes or Markup Tags do not include conditional statements. If you want them, you must create .phtml blocks and reference them with a CMS Macro that calls the block.

answered Feb 22, 2016 at 7:40
1
  • I have nearly about 30-35 CMS Pages which I want to display in both the themes differently..So should I create Cms pages for both the themes like about 60-70 Cms pages ? Commented Feb 22, 2016 at 8:32
0

correct code is:

{{if data.request_quote}} Yes {{else}} No {{/if}}

You should give request_quote a boolean value (or leave it empty if it is not "on")

answered Jan 16, 2019 at 11:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.