Re: Radio Select Widget

Michael Emmerich via opencms-dev <[email protected]> Fri, 1 Aug 2025 14:45:32 +0200
Newsgroups gmane.comp.cms.opencms.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============0185248529863242935==
Content-Type: multipart/alternative;
 boundary="------------XMOA0BCRosgtdMy0GlFOAT2L"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------XMOA0BCRosgtdMy0GlFOAT2L
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Atle,

the page in the documentation unfortunately uses the old syntax (which 
still works) to define widgets and not the <FieldSettings> that should 
be used today.

You can use the RadioButton widget in the editor like this:

If you have a field defined in your xsd

  <xsd:element name="Test" type="OpenCmsString"  />

The Settings for it is this to use the RadioButton Widget:

  [...]
   <xsd:annotation>
         <xsd:appinfo>
             [...]
             <FieldSettings>
                 [...]
                 <Setting>
*<PropertyName>Test</PropertyName>
                     <Widget>radio</Widget>
                     <WidgetConfig>Option 1|Option 2*|Option 3|Option 
4</WidgetConfig>*
                 </Setting>
                 [...]
             </FieldSettings>
         </xsd:appinfo>
     </xsd:annotation>
[...]

We will take a look that we fix the link in the next documentation update.

The correct one is

https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-1c482dc6

Kind regards,

Michael


Am 01.08.25 um 13:57 schrieb Atle Enersen via opencms-dev:
>
> Hello.
>
> I consulted the documentation and found this 
> https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-0b1b7f70 
> . It refers to 
> https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-0b1b7f70 
> but that does not exist...
>
> Does anyone have an example for the XSD on a radio button 
> configuration with four elements?
>
> Best regards/Vennlig hilsen, Atle Enersen
>
> -- 
>
> Tel.: +47 48 06 31 71
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
-- 
Michael Emmerich
  

Alkacon Software GmbH & Co. KG - The OpenCms Experts
http://www.alkacon.com
http://www.opencms.org

--------------XMOA0BCRosgtdMy0GlFOAT2L
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Atle,</p>
    <p>the page in the documentation unfortunately uses the old syntax
      (which still works) to define widgets and not the
      &lt;FieldSettings&gt; that should be used today.</p>
    <p>You can use the RadioButton widget in the editor like this:</p>
    <p>If you have a field defined in your xsd </p>
    <p> &lt;xsd:element name="Test" type="OpenCmsString"  /&gt;</p>
    <p>The Settings for it is this to use the RadioButton Widget:</p>
    <p> [...]<br>
        &lt;xsd:annotation&gt;<br>
              &lt;xsd:appinfo&gt;<br>
                  [...]<br>
                  &lt;FieldSettings&gt;<br>
                      [...]<br>
                      &lt;Setting&gt;<br>
           <b>              
        &lt;PropertyName&gt;Test&lt;/PropertyName&gt;<br>
                            &lt;Widget&gt;radio&lt;/Widget&gt;         
                 <br>
                            &lt;WidgetConfig&gt;Option 1|Option
        2*|Option 3|Option 4&lt;/WidgetConfig&gt;</b><br>
                      &lt;/Setting&gt;  <br>
                      [...]<br>
                  &lt;/FieldSettings&gt;<br>
              &lt;/xsd:appinfo&gt;<br>
          &lt;/xsd:annotation&gt;<br>
      [...]</p>
    <p>We will take a look that we fix the link in the next
      documentation update.</p>
    <p>The correct one is</p>
    <p><a class="moz-txt-link-freetext" href="https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-1c482dc6">https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-1c482dc6</a></p>
    <p>Kind regards,</p>
    <p>Michael</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Am 01.08.25 um 13:57 schrieb Atle
      Enersen via opencms-dev:<br>
    </div>
    <blockquote type="cite"
cite="mid:VI1PR10MB2063175CBC47F9CF67938696A926A@VI1PR10MB2063.EURPRD10.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator"
        content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
	{font-family:Aptos;
	panose-1:2 11 0 4 2 2 2 2 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;
	mso-ligatures:standardcontextual;
	mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#467886;
	text-decoration:underline;}span.EpostStil17
	{mso-style-type:personal-compose;
	font-family:"Aptos",sans-serif;
	color:windowtext;}.MsoChpDefault
	{mso-style-type:export-only;
	mso-fareast-language:EN-US;}div.WordSection1
	{page:WordSection1;}</style>
      <div class="WordSection1">
        <p class="MsoNormal">Hello.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I consulted the documentation and found
          this <a
href="https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-0b1b7f70"
            moz-do-not-send="true" class="moz-txt-link-freetext">
https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-0b1b7f70</a>
          . It refers to
          <a
href="https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-0b1b7f70"
            moz-do-not-send="true" class="moz-txt-link-freetext">
https://documentation.opencms.org/opencms-documentation/template-development/content-editor-configuration/widget-configuration/index.html#select-widget-configuration-0b1b7f70</a>
          but that does not exist...<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Does anyone have an example for the XSD on
          a radio button configuration with four elements?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <p class="MsoNormal"><span
                style="mso-ligatures:none;mso-fareast-language:NO-BOK">Best
                regards/Vennlig hilsen, Atle Enersen<o:p></o:p></span></p>
            <p class="MsoNormal"><span
                style="mso-ligatures:none;mso-fareast-language:NO-BOK">-- <o:p></o:p></span></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="mso-ligatures:none">Tel.:
                +47 48 06 31 71<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="https://lists.opencms.org/mailman/listinfo/opencms-dev">https://lists.opencms.org/mailman/listinfo/opencms-dev</a>



</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Michael Emmerich
 

Alkacon Software GmbH &amp; Co. KG - The OpenCms Experts
<a class="moz-txt-link-freetext" href="http://www.alkacon.com">http://www.alkacon.com</a>
<a class="moz-txt-link-freetext" href="http://www.opencms.org">http://www.opencms.org</a>
</pre>
  </body>
</html>

--------------XMOA0BCRosgtdMy0GlFOAT2L--

--===============0185248529863242935==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVGhpcyBtYWls
IGlzIHNlbnQgdG8geW91IGZyb20gdGhlIG9wZW5jbXMtZGV2IG1haWxpbmcgbGlzdApUbyBjaGFu
Z2UgeW91ciBsaXN0IG9wdGlvbnMsIG9yIHRvIHVuc3Vic2NyaWJlIGZyb20gdGhlIGxpc3QsIHBs
ZWFzZSB2aXNpdApodHRwczovL2xpc3RzLm9wZW5jbXMub3JnL21haWxtYW4vbGlzdGluZm8vb3Bl
bmNtcy1kZXYKCgoK

--===============0185248529863242935==--