Anja
I'm new here

Show input field depending of content area contains elements or not

Jump to solution

It is possible to define a rule on a page to show an input field depending on existing content within a content area or not?

And if yes - how can I do this?

Thanks for feedback.

Anja

0 Kudos
1 Solution

Accepted Solutions
sebastianc
Crownpeak employee

Hi Anja,

unfortunately using just the FirstSpirit rules it is currently not possible to check if there is content within a given content area.

There could be a way to do it, but it will require some module development where you need to implement some sort of ValueService.

Best regards,
Sebastian

View solution in original post

0 Kudos
4 Replies
rednoss
I'm new here

Hello Anja,

which FirstSpirit version do you use (content area is deprecated)?

In the example below are two input components (CMS_INPUT_DOM and CMS_INPUT_TEXT). The text component gets visible as soon as you type in content in the dom component.

<CMS_MODULE>

    <CMS_INPUT_DOM name="st_dom">

        <LANGINFOS>

            <LANGINFO lang="*" label="Text area" />

        </LANGINFOS>

    </CMS_INPUT_DOM>

    <CMS_INPUT_TEXT name="st_text" singleLine="no">

        <LANGINFOS>

            <LANGINFO lang="*" label="Text field" />

        </LANGINFOS>

    </CMS_INPUT_TEXT>

</CMS_MODULE>

<RULES>

    <RULE>

        <WITH>

            <NOT>

                <PROPERTY name="EMPTY" source="st_dom" />

            </NOT>

        </WITH>

        <DO>

            <PROPERTY name="VISIBLE" source="st_text" />

        </DO>

    </RULE>

</RULES>

Best regards

Rene

0 Kudos

FS 5.2.518.75105

Hi René,

This was not my question. Your example is a standard one which we are using very often.

We have a page template with an content area Content. On the page itself we have an input component text field.

The text field should only be visible if in the content area Content section(s) are maintained, that means the content area isn't empty.

How can I implement this by using a rule?

BR Anja

0 Kudos

Hello Anja,

you mean by page the preview (rendered html) or the instantiation of the page template as page inside the page store?

Regards,

Marian

0 Kudos
sebastianc
Crownpeak employee

Hi Anja,

unfortunately using just the FirstSpirit rules it is currently not possible to check if there is content within a given content area.

There could be a way to do it, but it will require some module development where you need to implement some sort of ValueService.

Best regards,
Sebastian

0 Kudos