I'm using a cms:editable of type 'checkbox'. Let's say it's called 'letters', and the values are 'A | B | C'. Now I know that if the user checks only the first two, I'll end up with 'letters' being equal to 'A | B'. So is there an easy way to use cms:if to test for the value containing 'A' or containing 'B' (contains as opposed to being equal to)? Or do I have to go over to native PHP there?
- Code: Select all
<cms:each var=letters as='item' sep='|' >
<cms:if item='A' || item='B' > A or B are checked! </cms:if>
</cms:each>
If you are a real lover of RegEx, you can construct your own expression to test inputted data.
- Code: Select all
<cms:if "<cms:validate value=letters validator='regex..' />">
A basic example may suit your use-case.
Or you can define a completely custom validator. More details about that are in tags.php line 5850. Unfortunately, I have no other source of info on this very powerful option. Nevertheless, I think the previous two options are solving your query.