Dashboard > RIFE > ... > Web engine > Grouping elements
RIFE Log In | Sign Up   View a printable version of the current page.
Grouping elements


Added by Steven Grimm, last edited by Geert Bevin on Jul 18, 2006  (view change)
Labels: 
(None)

Grouping elements is a simple way to make a site more strictly structured. Global variables that are defined inside a group are only available within the group. The same is true for global exits. A group also allows you to setup inheritance for a number of elements without having to resort to a subsite. A handy side-effect of using a group is that only the global variables inside the group are reset when a departure is called.

Grouping elements is done in the site definition by placing the elements in a group tag.

You can think of groups as subsites, with the distinct difference that they aren't declared in a different XML file and they have no unique id or url prefix.

Showing the group tag being used
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE site SYSTEM "/dtd/site.dtd">

<site>

  <element id="HOME" file="home.xml" url="/home" />

  <group>
    <globalexit name="menu" destid="ADMIN_MENU"/>

    <element id="ADD_USER" file="add-user.xml" url="/add_user" />
    <element id="DEL_USER" file="del-user.xml" url="/del_user" />

    <element id="ADMIN_MENU" file="admin-menu.xml" url="/admin_menu" />
  </group>

  <group>
    <globalexit name="menu" destid="SETTINGS_MENU"/>

    <element id="THEME" file="theme.xml" url="/theme" />
    <element id="LANG" file="lang.xml" url="/lang" />

    <element id="SETTINGS_MENU" file="settings-menu.xml" url="/settings-menu" />
  </group>
</site>

The example above shows two different groups, one for settings and one for administration. When a user goes to the settings part of the site he can go to the settings menu and when he goes to the admin part of the site he can go to the admin menu. Notice how the names of both the global exits are menu. This is possible since they are defined in different groups.

Departures

You can force all global variables to be reset inside the same group by using departures.



Are you enjoying Confluence? Please consider purchasing it today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.1a Build:#515 May 19, 2006) - Bug/feature request - Contact Administrators