Jump to content

Grouping attributes

From NusaATK
Revision as of 13:28, 12 February 2010 by bahtiar (talk | contribs) (Groups)

ATK Howto: Grouping attributes

Complexity: easy
Author: Sandy Pleyte <sandy at achievo.org>

List of other Howto's

Requirements

ATK 6.2+

Summary

In a node it's possible to group attributes for an edit form on 2 ways. With a group and a section.

Sections will create a node level tabbed pane. For tabs as an attribute. See: Grouping attributes into tabs

Sections

Groups a list with attributes on multiple lines which are collapsed by default. When you open a section it will retrieve the attributes with ajax. Sections always appear at the bottom.

Syntax:

$this->add(new atkAttribute('test'),'default.section');

In your node file use the following line to add an acttribute to the section 'address':

$this->add(new atkNumberAttribute('housenumber'), 'default.address');
$this->add(new atkAttribute('housenumber_suffix'), 'default.address');

The convention is: <tabname>.<sectionname>, in other words, the above places the attributes in the 'address' section of the default tab. Accepted notations:

  • ".address" - Put attribute in the address section if there are no tabs, or on the default tab
  • "billing" - Put attribute on the address tab
  • "billing.address" - Put attribute in the address section of the billing tab