[opencms-dev] Schema Default - advanced logic

Thomas Schmidt t.schmidt at md-network.de
Sat Feb 13 01:52:06 CET 2021


Hello,
i’m struggling to understand what kind of API is behind the Schema definition and the properties could be used to manipulate e.g. defaults.
E.g. I have a „Author“ field which should make use of the First and Last Name of the OpenCMS user Database:

-.-.-.-.-.-. schnipp -.-.-.-.-.-.

<Setting>
     <PropertyName>Author</PropertyName>
     <Widget>string</Widget>
     <Default><![CDATA[%(currentuser.firstname) %(currentuser.lastname)]]></Default>
 </Setting>

-.-.-.-.-.-. schnapp -.-.-.-.-.-.

Now I wonder if there is a possibility instead of using the full first and the full last name to put only initials as default. Is there anything like „substring“ possible ?
When going through all the examples it apears that quiet some (XPath?!) logic  might be possible - but it is hard to understand hwo it really works.

Thanks
Kind Regards
ThomasS



More information about the opencms-dev mailing list