Search the FirstSpirit Knowledge Base
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
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
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.
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
Yes, the link I provided is for FS_LIST. Sorry.