AnsweredAssumed Answered

Datalist - Display richtext without html tags

Question asked by benjamindupont on Oct 29, 2014
Hello,
I created a custom datalist, where a field use richtext in the form (the field allows to have bold, italic, etc ; it uses TinyMCE). It works well in editing view but, in the main datalist view, it's in plain text with html tags which is displayed… I had a picture, to sure of being understood.
Anyone have a solution ? Is it the type of <control template =""> which is bad ?
This is my code in config-custom.xml :

<config evaluator="model-type" condition="dl:journal" replace="true">
      <forms>
         <!– Create item form –>
         <form>
            <field-visibility>
               <!– dl:event type –>
                <!– cm:titled aspect –>
               <show id="dl:jpTitre" />
               <show id="dl:jpDate" />
               <show id="dl:jpDescription" />
               <!– cm:attachable aspect –>
               <show id="cm:attachments" />
            </field-visibility>
            <create-form template="../data-lists/forms/dataitem.ftl" />
            <appearance>
                <field id="dl:jpTitre">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" >
                                <control-param name="style">width:450px</control-param>
                        </control>
               </field>
               <field id="dl:jpDate">
                        <control template="/org/alfresco/components/form/controls/date.ftl">
                                <control-param name="forceEditable">true</control-param>
                                <control-param name="style">width:250px</control-param>
                        </control>
               </field>
               <field id="dl:jpDescription">
                        <control template="/org/alfresco/components/form/controls/richtext.ftl">
                                <control-param name="style">width:750px</control-param>
                                <control-param name="rows">10</control-param>
                        </control>
               </field>
               <field id="cm:attachments">
                  <control template="/org/alfresco/components/form/controls/attachments.ftl">
                    <control-param name="startLocation">{doclib}</control-param>
                    <control-param name="showTargetLink">true</control-param>
                  </control>
               </field>
            </appearance>
         </form>
         <form id="datagrid">
            <field-visibility>
               <!– dl:event type –>
               <show id="dl:jpTitre" />
               <show id="dl:jpDate" />
               <show id="dl:jpDescription" />
               <!– cm:attachable aspect –>
               <show id="cm:attachments" />
               <show id="cm:creator" />
               <show id="cm:created" />
               <show id="cm:modifier" />
               <show id="cm:modified" />
            </field-visibility>
         </form>
   <config evaluator="node-type" condition="dl:journal" replace="true">
      <forms>
         <!– Data List pop-up edit form –>
         <form>
            <field-visibility>
               <!– dl:contact type –>
               <!– dl:event type –>
                <!– cm:titled aspect –>
               <!– dl:event type –>
               <show id="dl:jpTitre" />
               <show id="dl:jpDate" />
               <show id="dl:jpDescription" />
               <!– cm:attachable aspect –>
               <show id="cm:attachments" />
               <!– dl:event type –>
               <show id="fm:discussable"/>
               <show id="cm:creator" />
               <show id="cm:created" />
               <show id="cm:modifier" />
               <show id="cm:modified" />
            </field-visibility>
            <edit-form template="../data-lists/forms/dataitem-edit.ftl" />
            <view-form template="../data-lists/forms/dataitem-view.ftl" />
            <appearance>
               <set id="normal" appearance=""/>
               <set id="other" appearance=""/>

               <field id="dl:jpTitre" set="normal">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" >
                                <control-param name="style">width:450px</control-param>
                        </control>
               </field>
               <field id="dl:jpDate" set="normal"/>
               <field id="dl:jpDescription" set="normal">
                        <control template="/org/alfresco/components/form/controls/richtext.ftl" >
                                <control-param name="style">width:450px</control-param>
                                <control-param name="rows">10</control-param>
                        </control>
               </field>
               <field id="cm:attachments" set="normal">
                  <control template="/org/alfresco/components/form/controls/attachments.ftl">
                    <control-param name="startLocation">{doclib}</control-param>
                    <control-param name="showTargetLink">true</control-param>
                  </control>
               </field>
               <field id="fm:discussable" label-id="form.label.comments" set="other">
                  <control template="/org/alfresco/components/form/controls/comments.ftl">
                      <control-param name="style">width:450px;</control-param>
                  </control>
               </field>
               <field id="cm:creator" set="other">
                        <control template="/org/alfresco/components/form/controls/extended-person.ftl"/>
                </field>
               <field id="cm:created" set="normal"/>
               <field id="cm:modifier" set="other">
                        <control template="/org/alfresco/components/form/controls/extended-person.ftl"/>
                </field>
               <field id="cm:modified" set="normal"/>
            </appearance>
         </form>
      </forms>
   </config>

Attachments

Outcomes