Search code examples
opencms

OpenCms Element (may be page) properties


I am working with OpenCms 8, I having a problem I am suppose to define custom properties to page and external links, but when we define new properties one can add any input, I want to limit that input, i.e. Yes/No, is it possible any suggestions?

Best Regards


Solution

  • With custom properties, do you mean 'properties' as the one you define when clicking on the page's icon and the selecting 'properties', or do you mean custom fields (let's call it attributes) in the schema xsd for your specific page type? Because that's a difference. For properties, you can't validate the user's input, for attributes (which you can also map to properties on the other hand), you can restrict the user's input, i.e. by still keeping the type to 'string', however, only providing a selection list with 'yes'/'no' as the options.

    To answer your question more precisely, please let me know which schema/xsd you're using for your page. Are you new to OpenCms, or have you used it before? Just to understand your experience level with it.