oschlueter
I'm new here

Limit the amount of selections in a CMS_INPUT_LIST

Jump to solution

Hello community,

we want to provide means to select a limited amount of elements, for this purpose we tried to use a CMS_INPUT_LIST filled with <CMS_INCLUDE_OPTIONS type="database">. This works quite well, unfortunately we were unable to restrict the amount of selected elements using rules, here is what we tried:


<RULES>

       <ON_SAVE>

             <WITH>

                   <NOT>

                         <GREATER_THAN>

                               <PROPERTY source="st_country_list" name="SIZE"/>

                               <NUMBER>5</NUMBER>

                         </GREATER_THAN>

                   </NOT>

             </WITH>

             <DO>

                   <VALIDATION>

                         <PROPERTY source="st_country_list" name="VALID"/>

                         <MESSAGE lang="*" text="No more than five countries may be selected!"/>

                   </VALIDATION>

             </DO>

       </ON_SAVE>

</RULES>

Neither did using <PROPERTY source="st_country_list" name="LENGTH"/> yield the desired result.

Are we doing something wrong or would we have to implement a custom value service for this?

Regards,

Oliver

0 Kudos
1 Solution

Accepted Solutions
StefanSchulz
I'm new here

Hi Oliver,

Did you check the log files for warnings on unknown properties? There is neither a SIZE nor a LENGTH property defined for CMS_INPUT_LIST in any released version of FirstSpirit.

Cheers,

Stefan

View solution in original post

0 Kudos
3 Replies
Peter_Jodeleit
Crownpeak employee

According to http://www.e-spirit.com/odfs51/Template-development/Rules/Comparative-expressions/EQUAL-tag/?communi... SIZE should work.

Which FirstSpirit version do you work with?

Hint: Instead of <NOT><GREATER_THAN> you could use <LESS_THAN> with adjusted count.

[EDIT]

The link is referring to FS_LIST, not CMS_INPUT_LIST.

Peter
0 Kudos
StefanSchulz
I'm new here

Hi Oliver,

Did you check the log files for warnings on unknown properties? There is neither a SIZE nor a LENGTH property defined for CMS_INPUT_LIST in any released version of FirstSpirit.

Cheers,

Stefan

0 Kudos

Yes, the link I provided is for FS_LIST. Sorry.

Peter
0 Kudos