In addition to the field instance default and schema (which are stored in the database via the Field API mechanism), this module allows for much finer-grained control of defaults and schemas, even down to the individual entity or even entity field level, e.g. $node->field_xml
.
For this type of control, defaults and schemas are provided using include files in either your custom module or the public files directory. In both cases, we'll use the familiar form of suggestion filename convention found throughout Drupal.
For schema definitions use this cascade:
entity_type--entity_id--field_id.xsd
entity_type--entity_id.xsd
entity_type--bundle_type--field_id.xsd
entity_type--bundle_type.xsd
entity_type--field_id.xsd
entity_type.xsd
default.xsd
For field defaults use this cascade:
entity_type--entity_id--field_id.xml
entity_type--entity_id.xml
entity_type--bundle_type--field_id.xml
entity_type--bundle_type.xml
entity_type--field_id.xml
entity_type.xml
default.xml
hook_xml_field_api()
? If using a custom module you will place these files in:
my_module/includes/xml_field/
You must also implement hook_xml_field_api()
in your module to let xml_field know to look in your module directory for these files. See xml_field.api.php
for more info.
You may also place include files in the public files of Drupal, however they will have the lowest weight when conflicting with a module-provided file of the same name.
public://xml_field/