Skip to main content

How to apply rules in CMS_INPUT_DOM

Comments

3 comments

  • Zendesk API User
    Author: marza - 4/6/2017 15:14

    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
  • Zendesk API User
    Author: sajul - 4/7/2017 2:50

    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 :smileyhappy:

    Regards

    Sajul

    0
  • Zendesk API User
    Author: brueder - 4/18/2017 13:38

    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

Please sign in to leave a comment.