MetaLocator's category system is a fundamental component of the software.  Understanding the category system is key to unlocking powerful features such as:

This article will cover some more advanced aspects of categorization, including grouping categories and leveraging category parent-child relationships to build cascading form selections.

Grouping Categories

When categories are grouped, it impacts their display in two primary ways.  First, when displayed in an Item Template as {taglist}, or {taglistwithdescription} the list of categories is output as an unordered list (ul) with Category Group Names used as bolded labels as shown below:

In the above example, Products, Services and Type are the Category Group names.

Additionally, the Category Group Names are also used to group Search Form options.  Within Form Settings > Search Form, a common search option is Category Check Boxes, shown in the editor as {tagcheckboxes} as shown below:

When the available categories are grouped, the {tagcheckboxes} and the {tagdropdown} tags display as a series of drop-downs or checkboxes, one for each group as shown below:

Parent Child Relationships between Grouped Categories

Categories can have parents and children that allow you to enable or disable child category options based on the selection of parents.  This relationship is leveraged in the Search Form when displaying multiple grouped drop-down lists with {tagdropdown} and Form Settings > Chain grouped category drop-downs? is set to Yes.

This allows you to disable a group of child category inputs until a certain parent category is selected.  In this example, there are two groups of categories, Primary and Secondary.  Every member of the Secondary group is set as a Child of the "Retailer" category.  Notice that before a selection in Primary is made, the Secondary option is disabled.  When choosing Retailer from the Primary, the children of Retailer will appear in the Secondary drop-down.  Members of the secondary group that are not children of Retailer will not be in the secondary drop-down and are not select-able in this scenario.

 

Category and Category Group Ordering

Categories are assigned a sequential ordering number during the import process.  To re-arrange the categories manually, click Categories, then click the Order column, notice a draggable icon appears as shown in this video:

https://www.metalocator.com/wp-content/uploads/2016/10/dragordering.mp4

To manually adjust category ordering and category group ordering, edit the category as shown below:

Categories with a higher ordering value appear lower in this administrative list.  The ordering is reversed on the public-facing interfaces, meaning categories with higher ordering values appear first in the list of categories when presented to the end user in a drop-down or category list.

Categories also have a group-level ordering called Category Group Order.  This is useful when displaying a list of categories in groups and you want to control the ordering of the presentation of the groups.  Edit the category group ordering by editing any category in that group.  Set the ordering value as a number and every other category in that group will be appropriately updated with the new group ordering.

In the above example, the Primary group has an ordering value of 0 and the Secondary group has an ordering value of 1.  This sorting is the opposite behavior of the category ordering.  In category groups, lower numbers appear first in the display.  In the below example, we have set the Secondary ordering value to 1 and the Primary group ordering value to 2.

Filtering Categories in the Search Form

In certain contexts you may want to hide the display of a category or categories.  This might occur in the Search Form, or in the MetaLocator Template tags like {taglistwithdescription} or {taglist}.  To hide a category from the drop-downs or check-boxes in the search form, modify the category settings to disable "Show in Search" for that category.

Filtering Categories in the Templates

When displaying category lists in the templates by using {taglist} or {taglistwithdescription} you can limit the content by including a tag_group filter.  For example {taglist tag_group="Products and Services"} will show only tags in the Products and Services group, as set under the category's options as shown below.  If a language constant has been provided for the tag_group, you must filter with that constant instead of the group name as LOCATOR_TAG_GROUP_PRODUCTSANDSERVICES, as in {taglist tag_group="LOCATOR_TAG_GROUP_PRODUCTSANDSERVICES"}

Filtering in the Location Form

If you are using our Location Form Layout, which allows visitors to submit locations to your database, you can limit their choices by preventing display of certain categories by setting "Show in front-end location form?" to No as shown below:

Did this answer your question?