<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Make description field hidden on custom types in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/make-description-field-hidden-on-custom-types/m-p/319073#M6074</link>
    <description>&lt;P&gt;I have created some custom types which contain some fiels in addtion to title (dc:title) and description (dc:description) ; now i want to make the description field hidden. I mean it will contain some data but i don't want it to be shown to users. I've made some research and found that i can use this code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;widgetModes&amp;gt;
  &amp;lt;mode value="view"&amp;gt;#{empty layoutValue.dc.format?'hidden':'view'}&amp;lt;/mode&amp;gt;
&amp;lt;/widgetModes&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But i can't find where to put it . Any help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2015 08:38:45 GMT</pubDate>
    <dc:creator>ITShine_</dc:creator>
    <dc:date>2015-09-14T08:38:45Z</dc:date>
    <item>
      <title>Make description field hidden on custom types</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/make-description-field-hidden-on-custom-types/m-p/319073#M6074</link>
      <description>&lt;P&gt;I have created some custom types which contain some fiels in addtion to title (dc:title) and description (dc:description) ; now i want to make the description field hidden. I mean it will contain some data but i don't want it to be shown to users. I've made some research and found that i can use this code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;widgetModes&amp;gt;
  &amp;lt;mode value="view"&amp;gt;#{empty layoutValue.dc.format?'hidden':'view'}&amp;lt;/mode&amp;gt;
&amp;lt;/widgetModes&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But i can't find where to put it . Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 08:38:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/make-description-field-hidden-on-custom-types/m-p/319073#M6074</guid>
      <dc:creator>ITShine_</dc:creator>
      <dc:date>2015-09-14T08:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Make description field hidden on custom types</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/make-description-field-hidden-on-custom-types/m-p/319074#M6075</link>
      <description>&lt;P&gt;As you just want to hide the field from viewing in the layout, you can just create your custom layout extension. For example, you provide dc:title and dc:description in the create mode but not in the read mode. In this case the layout row and the dc:description related widget are simply removed from the layout definition.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; &amp;lt;extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="layouts"&amp;gt;
 
 &amp;lt;layout name="layout@customType-create"&amp;gt;
            &amp;lt;templates&amp;gt;
                &amp;lt;template mode="any"&amp;gt;/layouts/custom_layout_template.xhtml&amp;lt;/template&amp;gt;
            &amp;lt;/templates&amp;gt;
            &amp;lt;rows&amp;gt;
                &amp;lt;row&amp;gt;
                    &amp;lt;properties mode="any"&amp;gt;
                        &amp;lt;property name="nxl_colspan_0"&amp;gt;1&amp;lt;/property&amp;gt;
                    &amp;lt;/properties&amp;gt;
                    &amp;lt;widget&amp;gt;title&amp;lt;/widget&amp;gt;
                &amp;lt;/row&amp;gt;
                &amp;lt;row&amp;gt;
                    &amp;lt;properties mode="any"&amp;gt;
                        &amp;lt;property name="nxl_colspan_0"&amp;gt;1&amp;lt;/property&amp;gt;
                    &amp;lt;/properties&amp;gt;
                    &amp;lt;widget&amp;gt;description&amp;lt;/widget&amp;gt;
                &amp;lt;/row&amp;gt;
            &amp;lt;/rows&amp;gt;
            &amp;lt;widget name="title" type="text"&amp;gt;
                &amp;lt;labels&amp;gt;
                    &amp;lt;label mode="any"&amp;gt;Title&amp;lt;/label&amp;gt;
                &amp;lt;/labels&amp;gt;
                &amp;lt;translated&amp;gt;true&amp;lt;/translated&amp;gt;
                &amp;lt;fields&amp;gt;
                    &amp;lt;field&amp;gt;dc:title&amp;lt;/field&amp;gt;
                &amp;lt;/fields&amp;gt;
                &amp;lt;properties widgetMode="edit"&amp;gt;
                    &amp;lt;property name="styleClass"&amp;gt;dataInputText&amp;lt;/property&amp;gt;
                    &amp;lt;property name="required"&amp;gt;true&amp;lt;/property&amp;gt;
                &amp;lt;/properties&amp;gt;
            &amp;lt;/widget&amp;gt;
            &amp;lt;widget name="description" type="textarea"&amp;gt;
                &amp;lt;labels&amp;gt;
                    &amp;lt;label mode="any"&amp;gt;Description&amp;lt;/label&amp;gt;
                &amp;lt;/labels&amp;gt;
                &amp;lt;translated&amp;gt;true&amp;lt;/translated&amp;gt;
                &amp;lt;fields&amp;gt;
                    &amp;lt;field&amp;gt;dc:description&amp;lt;/field&amp;gt;
                &amp;lt;/fields&amp;gt;
                &amp;lt;properties widgetMode="edit"&amp;gt;
                    &amp;lt;property name="styleClass"&amp;gt;dataInputText&amp;lt;/property&amp;gt;
                &amp;lt;/properties&amp;gt;
            &amp;lt;/widget&amp;gt;
        &amp;lt;/layout&amp;gt;
        
        &amp;lt;layout name="layout@customType-view"&amp;gt;
            &amp;lt;templates&amp;gt;
                &amp;lt;template mode="any"&amp;gt;/layouts/custom_layout_template.xhtml&amp;lt;/template&amp;gt;
            &amp;lt;/templates&amp;gt;
            &amp;lt;rows&amp;gt;
                &amp;lt;row&amp;gt;
                    &amp;lt;properties mode="any"&amp;gt;
                        &amp;lt;property name="nxl_colspan_0"&amp;gt;1&amp;lt;/property&amp;gt;
                    &amp;lt;/properties&amp;gt;
                    &amp;lt;widget&amp;gt;title&amp;lt;/widget&amp;gt;
                &amp;lt;/row&amp;gt;
            &amp;lt;/rows&amp;gt;
            &amp;lt;widget name="title" type="text"&amp;gt;
                &amp;lt;labels&amp;gt;
                    &amp;lt;label mode="any"&amp;gt;Title&amp;lt;/label&amp;gt;
                &amp;lt;/labels&amp;gt;
                &amp;lt;translated&amp;gt;true&amp;lt;/translated&amp;gt;
                &amp;lt;fields&amp;gt;
                    &amp;lt;field&amp;gt;dc:title&amp;lt;/field&amp;gt;
                &amp;lt;/fields&amp;gt;
            &amp;lt;/widget&amp;gt;
        &amp;lt;/layout&amp;gt;
        
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the availability should be handled permission based (custom permission or user group) you can follow the guidelines here: &lt;A href="https://doc.nuxeo.com/display/NXDOC/How+to+Control+the+Display+Mode+of+a+Widget" target="test_blank"&gt;https://doc.nuxeo.com/display/NXDOC/How+to+Control+the+Display+Mode+of+a+Widget&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But in general you end up with a widgetMode entry like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;widgetModes&amp;gt;
    &amp;lt;mode value="view"&amp;gt;#{nxd:hasPermission(layoutValue, 'customPermission')?'view'}&amp;lt;/mode&amp;gt;
&amp;lt;/widgetModes&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this info helps you.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 13:19:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/make-description-field-hidden-on-custom-types/m-p/319074#M6075</guid>
      <dc:creator>ssze_</dc:creator>
      <dc:date>2015-09-16T13:19:37Z</dc:date>
    </item>
  </channel>
</rss>

