Skip to content

Instantly share code, notes, and snippets.

@enonicnorway
Created June 29, 2015 13:40
Show Gist options
  • Save enonicnorway/cb61fc6d3a6e06b95c5d to your computer and use it in GitHub Desktop.
Save enonicnorway/cb61fc6d3a6e06b95c5d to your computer and use it in GitHub Desktop.
/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module>
<display-name>Your module name</display-name>
<info>Short explanation</info>
<url>http://enonic.com</url>
<vendor>
<name>Enonic AS</name>
<url>http://www.enonic.com</url>
</vendor>
<dependencies system-min-version="5.0.0" system-max-version="6.0.0"/>
<metadata-schemas>
<metadata-schema name="system:menu"/>
</metadata-schemas>
<!-- Here's the universal settings for this module that every created site that supports this module gets to set -->
<config>
<!-- Inputs placed inside a fieldset gets pushed a bit further to the right than other inputs. The name of the field-set is not displayed. So in a way using fieldsets in a module.xml is useless. -->
<field-set name="info">
<label>Website Settings</label>
<items>
<input type="TextLine" name="title"><!-- The name attribute is what you will use to get this data out in your html later. Type is one of many different types of input fields we have, check complete docs for more info! -->
<label>Site title</label>
<immutable>false</immutable><!-- Immutable is not implemented yet. Setting this value to true will cause the value in such a field to become a constant when it is implemented. -->
<indexed>true</indexed><!-- Indexed in not currently in use either, but required. Thought to indicate if the value should be indexed so it may be searchable, but will most likely be removed. -->
<occurrences minimum="1" maximum="1"/><!-- A value on minimum over 0 makes the field mandatory -->
</input>
<input type="TextArea" name="description">
<label>Description</label>
<immutable>false</immutable>
<indexed>true</indexed>
<help-text/>
<occurrences minimum="1" maximum="1"/>
</input>
</items>
</field-set>
</config>
<!-- These are mixins that the Module will add to every content-type (even included ones) you use on sites with this Module -->
<!-- So each content-type will get settings for "Show in menu", "Meta description", and such. -->
<x-data mixin="metadata"/><!-- Include a mixin called "metadata" -->
<!-- You'll find these mixins in the mixin-folder, each folder name corresponds to the name written here in the "mixin" attribute -->
</module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment