cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Title/Description from Document Type

Dalal_
Confirmed Champ
Confirmed Champ

I created my own contribution to document types, my custom document type contains the following fields: Montant, client, date, mode de règlement ONLY but in render the field Title/Description are added. I don't know how to remove them.

alt text

1 REPLY 1

Pradeep_Bhat
Star Contributor
Star Contributor

The Nuxeo defaultly provides Title and Description in its layout. I suggest you to load ur own layout in order to override the default layout given by nuxeo. So according to your need, create a "layout-contrib.xml" as below.

<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
	point="layouts">
	<layout name="ur_layout_name">
		<templates>
			<template mode="any">/layouts/layout_default_template.xhtml
			</template>
		</templates>

		<rows>
			<row>
				<widget>Montant</widget>
			</row>
			<row>
				<widget>client</widget>
			</row>
			<!-- As many fields u want-->
		</rows>
		
		<widget name="Montant" type="int">
			<labels>
				<label mode="any">Montant</label>
			</labels>
			<translated>false</translated>
			<fields>
				<field>lds:intField</field>
			</fields>
		</widget>

		<widget name="client" type="text">
			<labels>
				<label mode="any">Client</label>
			</labels>
			<translated>false</translated>
			<fields>
				<field>lds:textField</field>
			</fields>
		</widget>
	</layout>
</extension>
		
		

We need to define our own schema which defines few datatypes. So declare ur schema in core-types-contrib.xml.

<schema name="layout_demo_schema" prefix="lds" src="schema/layout_demo_schema.xsd" />

Define the datatypes which are needed. For example, here we want int, text, date field etc. So create ur schema layout_demo_schema.xsd and define these datatypes.

<xs:element name="intField" type="xs:int" />
<xs:element name="textField" type="xs:string" />

Don't forget to declare your layout in ui-types-contrib.xml.

<layouts mode="any">
	<layout>ur_layout_name</layout>
</layouts>

Even I wanted a similar customized folder type metadata and have a look at the attached image how i achieved. That's all, its easy to create custom fields in nuxeo and to play with it.