There's more...

The position attribute has two other possible values: replace and attributes. Using replace causes the selected element to be replaced with the content of the instruction element. Consequently, if you don't have any content, the selected element can simply be removed. The preceding list or form view would cause the email field to be removed:

<field name="email" position="replace" /> 
Warning:
Removing fields can cause other inheriting views to break and several other undesirable side effects, so avoid that if possible. If you really need to remove fields, do so in a view that comes late in the order of evaluation (refer to the next section, Order of evaluation in view inheritance for more information).

attributes have a very different semantic from the preceding examples. The processor expects the element to contain the attribute elements with a name attribute. These elements will then be used to set attributes on the selected element. If you want to heed the earlier warning, you should set the invisible attribute to 1 for the email field:

<field name="email" position="attributes">
    <attribute name="invisible">1</attribute>
</field>

An attribute node can have add and remove attributes, which in turn should contain the value to be removed from or added to the space separated list. This is very useful for the class attribute, where you'd add a class (instead of overwriting the whole attribute) by using the following:

<field name="email" position="attributes">
    <attribute name="class" add="oe_inline" />
</field>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset