Documentation Download as PDF

Custom Fields

Custom fields are one of many tools included in Caribou that allow you to tailor Caribou to your needs. There are five classes of custom fields that Caribou deals with. Each class is discussed below as they are all unique and implemented differently.

Article Custom Fields

These custom fields are seen when adding or editing Articles / Pages in the control panel. Validation doesn’t apply to these custom fields (it’s assumed that administrators will follow the rules).

Article custom fields are available in topic page templates or article page templates with variables of the format: $articlecustom_[custom field name]. For example, if you have a custom field called “Meta-Keywords”, you would include this in your header.html template (which is included in the article.html template, by default) like so:

<meta name="keywords" content="{$articlecustom_Meta-Keywords}" />

Also, if you want to have a custom field that has a link to an external site and call this field "External Link", you could include this in the article.html template like so:

{if $articlecustom_External Link != ""}
<p>Please visit this external site:
<a href="{$articlecustom_External Link}">{$articlecustom_External Link}</a>
</p>{/if}

The code above not only uses the custom field but also only uses it in the template if the custom field is not empty.

Topic Custom Fields

These custom fields are very similar to article custom fields except that they are seen when adding or editing topics. Validation doesn’t apply to these fields because, like articles, they are for administrators only.

Topic custom fields are included in article/page templates (e.g. article.html) with code in the format of $topiccustom_[custom field name]. For example, if you have a topic custom field like "Author Bio" which holds the current bio of the main author in the blog topic, you can use this in any article or topic template like so:

<p class="bio"><b>About the Author:</b><br />
{$topiccustom_Author Bio}</p>

Topic custom fields are include in topic templates (e.g. topic.html) in the format of $custom.[custom field name]. For example, if you have a custom field called "Video Link", you would use the following code:

Welcome to this topic!  Click <a href="{$custom.Video Link}">here</a> to
access the video for this topic.

User Custom Fields

Perhaps the most commonly used custom field class, user custom fields are fields that are added to the user registration form. All of the address elements in the user registration form by default are actually just custom fields (thus, they can be removed at any time).

Validation does apply to these custom fields and, if the form fields are not completed or completed improperly, the user will see detailed errors on the form and be prompted for correction.

Data collected in the custom fields is viewable and editable in the control panel when editing a user in Users > Member Search. If a field is marked as “Editable in the Account Manager”, users will be able to edit this data in their Account Manager under Edit Profile.

Affiliate User Custom Fields

This class of custom fields follows the same rules as User Custom Fields except that they apply to users who are registering as affiliates.

Product Custom Fields

Sometimes, certain information is necessary from a user for an individual product purchase made in your online store. This class of custom fields solves that problem. So, for example, if you perform an engraving on a product and need to know what to engrave, you may create a custom field called “Engraving Text” and apply it to the product. Then, when someone adds this product to their cart, they will fill in this information. Custom field data gathered here is viewable in Storefront > Orders for each order and in Users > Billing History when looking at all subscriptions and orders for a particular user. Validation applies to these fields so users must complete the fields properly before the product is added to their cart.

Gathering Other Information

If you want to gather other information from your users but can’t find a way to make it work with custom fields, you can create forms easily in Content > Forms. Forms can even be extended with form plugins that manipulate and use the data submitted to do other actions. See the Integrations section for details.