Jahia in English > How to define a...

0 (0 Good)
0 (0 Bad)

How to define a property as string with limited character size ?

by  thbaymet »  2015/11/23 16:34

Hi, I would like to know if it is possible to define a property in Jahia définition as "string" and set a limited character size ?

- text (string)

Can we add something like this ? 

- text (string) maxlength=20

It is not form elements, just for normal content definitions. 

Thanks,

Regards. 

  • How to define a property as string with limited character size ?
    2015/11/23 16:34

    thbaymet <p>Hi, I would like to know if it is possible to define a property in Jahia d&eacute;finition as &quot;string&quot; and set a limited character size ?</p> <pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Courier 10 Pitch';font-size:10,6pt;"> - text (string)</pre> <p>Can we add something like this ?&nbsp;</p> <pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Courier 10 Pitch';font-size:10,6pt;"> - text (string) maxlength=20</pre> <p>It is not form elements, just for normal content definitions.&nbsp;</p> <p>Thanks,</p> <p>Regards.&nbsp;</p>

  • Number of messages  19
    Registration date Nov 23, 2015
    1 (1 Good)
    0 (0 Bad)

    Re: How to define a property as string with limited character size ?

    by  shyrkov »  2015/11/24 09:27

    Hello,

    you coul enforce the length restriction using the regular expression, i.e.:

     - text (string) < '^.{0,20}$'

     

    Kind regards

    Sergiy

  • Re: How to define a property as string with limited character size ?
    2015/11/24 09:53

    shyrkov <p>Hello,</p> <p>you coul enforce the length restriction using the regular expression, i.e.:</p> <p>&nbsp;- text (string) &lt; &#39;^.{0,20}$&#39;</p> <p>&nbsp;</p> <p>Kind regards</p> <p>Sergiy</p>

  • Number of messages  407
    Registration date Nov 24, 2015
    0 (0 Good)
    0 (0 Bad)

    Re: Re: How to define a property as string with limited character size ?

    by  thbaymet »  2015/11/24 09:53

    Yes. It simply doesn't let the contributor save the content if the length of the string entered is more than 20 characters.

    [cant:blockService] > jnt:content
     - contentText (string) < '^.{0,20}$'

    Thanks. Regards.

  • Re: Re: How to define a property as string with limited character size ?
    2015/11/24 09:53

    thbaymet <p>Yes. It simply doesn&#39;t let the contributor save the content if the length of the string entered is more than 20 characters.</p> <pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Courier 10 Pitch';font-size:10,6pt;"> [cant:blockService] &gt; jnt:content - contentText (string) &lt; &#39;^.{0,20}$&#39;</pre> <p>Thanks. Regards.</p>

  • Number of messages  19
    Registration date Nov 24, 2015
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page