Hidden field with default value

Oct 25, 2011 at 11:59 AM


I use the Label datatype to set a default value of a field that the users should not be able to change. But it would be even better if the field could be entirely hidden (and still be set to a default).

Thanks for a great package

Oct 25, 2011 at 12:31 PM

Hi prgjonas!

You should be able to hide a field entirely by leaving out the umbracoDataType-attribute on the field definition. You can still set a default value. Following is from the documentation here on CP:
<editor tableName="DewdTypeTable">
  <field title="Title" sourceField="title" umbracoDataType="Textstring" />
  <field title="Numeric" type="NumericField" sourceField="testNumeric" umbracoDataType="Textstring" format="{0:0.00}" />
  <field title="Date" sourceField="testDate" umbracoDataType="Date Picker" />
  <field title="Internal guid" sourceField="testGuid"><nullable /><defaultValue get="guid" /></field>

The last field is not shown to the user at all.

Oct 25, 2011 at 1:45 PM

Ah, worked perfectly, thanks again.

Oct 25, 2011 at 2:00 PM

Exellent :)