How to use custom fields as virtual categories

From JReviews Documentation
Revision as of 09:39, 26 July 2013 by Jreviews (Talk | contribs)

Jump to: navigation, search

One of the biggest limitations of Joomla's category system is that it doesn't allow you to add a single article/listing to more than one category. Other limitation is that all categories must be setup before you submit articles/listings.

Let's say you want to create a site with restaurants. You might want to create "Restaurants" as the main category and cuisines as subcategories, i.e "American Cuisine", "French Cuisine", "Italian Cuisine", ... But since some restaurants serve more than one cuisine, this solution is not good because Joomla will not allow you to put the same restaurant to more than one cuisine category.

We recommend to create only a single "Restaurant" category without subcategories and use a JReviews custom field to create "virtual" cuisine categories.

If you want the ability to put a listing to more than one "virtual" category, create a Multiple select list or Checkboxes type of custom field, otherwise you can also use Single select or Radiobuttons field types.

Creating a custom field required for virtual categories

Go to the JReviews Fields Manager and create a custom field in a field group that belongs to your Restaurants listing type.

Virtual-categories.png

After you save the field, click the Field Options button to add the values ("virtual" categories):

Virtual-categories2.png

Assigning virtual categories to listings

If you created a Multiple select custom field, you will see something like this on the listing submit form:

Virtual-categories3.png

By holding the CTRL key (CMD on Mac), you can select more than one cuisine. To add a new cuisine, click the Add button.

If you enabled the Use Auto Complete UI option for this field, it would look like this:

Virtual-categories4.png

If you created a Checkboxes custom field instead of a multiple select, it would look like this:

Virtual-categories5.png

Advantage of checkboxes is that users can easily see all options and quickly pick the ones they want. Disadvantage is that it is not possible to add more options on the listing submit form, all of them must be created in the administration area.

Displaying virtual categories on the site