sajul
I'm new here

How to apply rules in CMS_INPUT_DOM

Jump to solution

Hi,

How to apply rules for template in formats tag, example like when I tick checkbox, list for template visible is  name:p and ft_h1, if untick ft_h2 and ft_h3 will visible

Thanks in advance.

<CMS_INPUT_TOGGLE name="checkBox">

        <LANGINFOS>

          <LANGINFO lang="*" label="test?"/>

        </LANGINFOS>

      </CMS_INPUT_TOGGLE>

<CMS_INPUT_DOM

        name="stText"

        bold="yes"

        hFill="yes"

        italic="yes"

        listConfig="style:Typ[1:Bullets|2:Numbers]"

        rows="5"

        useLanguages="yes">

        <FORMATS>

          <TEMPLATE name="p"/>

          <TEMPLATE name="ft_h1"/>

          <TEMPLATE name="ft_h2"/>

          <TEMPLATE name="ft_h3"/>

        </FORMATS>

</CMS_INPUT_DOM>

1 Solution

Accepted Solutions
marza
I'm new here

Hi Sajul,

you can only show or hide whole input components based on the boolean state of a check box. Please keep in mind that hidden means not that the component is gone. It is only not shown but will be still saved.

Take this real world example:

...

<CMS_INPUT_RADIOBUTTON name="pt_headerType" gridHeight="1" gridWidth="3" hFill="yes" useLanguages="no">

    <ENTRIES>

      <ENTRY value="none">

        <LANGINFOS>

          <LANGINFO lang="*" label="Without stage"/>

        </LANGINFOS>

      </ENTRY>

      <ENTRY value="category">

        <LANGINFOS>

          <LANGINFO lang="*" label="Category name"/>

        </LANGINFOS>

      </ENTRY>

      <ENTRY value="image">

        <LANGINFOS>

          <LANGINFO lang="*" label="Small stage"/>

        </LANGINFOS>

      </ENTRY>

    </ENTRIES>

    <LANGINFOS>

      <LANGINFO lang="*" label="Stage"/>

    </LANGINFOS>

  </CMS_INPUT_RADIOBUTTON>

  <CMS_GROUP name="cg_image">

    <LANGINFOS>

      <LANGINFO lang="*" label="Small stage"/>

    </LANGINFOS>

...

</CMS_GROUP>

...

Rules to show CMS-group only if the right radio-button is chosen:

<RULES>

  <ON_EVENT>

  <WITH>

  <EQUAL>

  <PROPERTY name="ENTRY" source="pt_headerType"/>

  <TEXT>image</TEXT>

  </EQUAL>

  </WITH>

  <DO>

  <PROPERTY name="VISIBLE" source="#form.cg_image"/>

  </DO>

  </ON_EVENT>

</RULES>

Of cause you can apply this on simple input components instead of CMS-groups too.

Regards

Marian

View solution in original post

0 Kudos
3 Replies
marza
I'm new here

Hi Sajul,

you can only show or hide whole input components based on the boolean state of a check box. Please keep in mind that hidden means not that the component is gone. It is only not shown but will be still saved.

Take this real world example:

...

<CMS_INPUT_RADIOBUTTON name="pt_headerType" gridHeight="1" gridWidth="3" hFill="yes" useLanguages="no">

    <ENTRIES>

      <ENTRY value="none">

        <LANGINFOS>

          <LANGINFO lang="*" label="Without stage"/>

        </LANGINFOS>

      </ENTRY>

      <ENTRY value="category">

        <LANGINFOS>

          <LANGINFO lang="*" label="Category name"/>

        </LANGINFOS>

      </ENTRY>

      <ENTRY value="image">

        <LANGINFOS>

          <LANGINFO lang="*" label="Small stage"/>

        </LANGINFOS>

      </ENTRY>

    </ENTRIES>

    <LANGINFOS>

      <LANGINFO lang="*" label="Stage"/>

    </LANGINFOS>

  </CMS_INPUT_RADIOBUTTON>

  <CMS_GROUP name="cg_image">

    <LANGINFOS>

      <LANGINFO lang="*" label="Small stage"/>

    </LANGINFOS>

...

</CMS_GROUP>

...

Rules to show CMS-group only if the right radio-button is chosen:

<RULES>

  <ON_EVENT>

  <WITH>

  <EQUAL>

  <PROPERTY name="ENTRY" source="pt_headerType"/>

  <TEXT>image</TEXT>

  </EQUAL>

  </WITH>

  <DO>

  <PROPERTY name="VISIBLE" source="#form.cg_image"/>

  </DO>

  </ON_EVENT>

</RULES>

Of cause you can apply this on simple input components instead of CMS-groups too.

Regards

Marian

0 Kudos

Hi Marian,

Thanks for your answer, ok noted, so it not possible to make a rule for the child element in input component at this moment.

I already doing like the example above, but the requirement I got need something like my question, so I go through the documentation and cannot find any rule like that, just need to confirm I raise the question here Smiley Happy

Regards

Sajul

0 Kudos

Hi Sajul,

I read your question that it has been answered by Marian already, therefore closing this post now. If you think this is wrong, feel free to open a new one!

Cheers,

Lena

0 Kudos