Reference fields allow you to populate content from a CMS group to Templates, Pages or Frames. For example, you may choose to Select Manually specific "related" products to display on a product landing page, including title, image and link to page; or you may dynamically Select All blog posts to display on your blog index page and then order those posts by date.
To leverage the power of Reference fields, you must first create a Section with a
Reference variable type. To do this, add a
Reference variable type to your Section in the Shogun Frontend IDE (image below). You can select multiple values to display multiple content items from the specified content type, or display a single item. Content Type corresponds to your CMS content group.
In the Experience Manager, you may add a Section to your Template, Page or Frame. For any Section with a multi-value Reference field, you will have the option to
Select All or
Select Manually to specify which CMS content items should be added to this Section.
Select All allows you to add all content items from the specified content group. The
Select All option gives you dynamic functionality. Shogun Frontend currently supports the following dynamic functionality:
- Select all content items from a content group
- Sort all content items by Date, ascending or descending
- Include or exclude draft content items from a content group. Draft content will only be displayed at your discretion
- Automatic population of new content items to the specified content group. Newly created content will only be visible on the live site when when published.
- Automatic sorting and ordering of newly added content items to the specified content group—if Sorting and Ordering criteria are selected and if date value provided
Future versions of this feature will allow for filtering by text field.
To sort your content items by date, follow the steps below:
Create a Date field type
In the CMS, add a new
Datefield type to your content group with a label of your choosing. This field will then be editable for each content item within your content group.
The Date field is offered specifically to help determine the order in which your content is displayed. It will not be shown in the Experience Manager in the same way other fields are shown and will not be available for development in the IDE.
- Add the date value
In the CMS, populate the date for each content item following the format MM/DD/YYYY.
- Select Sort Criteria
In the Experience Manager, select the Date field type, by label, that you would like to use to sort your content items. You will see
Displaying (#) items, which indicates the total number of content items displaying . This number will update in real time, as you filter and sort your content items.
- Select Order criteria
You may choose to display your content items by Newest first or Oldest first.
- Limit Results
You can limit the number of content items to display in your page.
- Include Draft Content
You can include or exclude draft content items from displaying.
When you create a Template in Shogun Frontend, you will connect your Template to a CMS content group. Then, the Template will generate a unique page for each content item in the content group.
When the Include Draft Content toggle is on, content from all of the pages, including those in Draft state, will be included. When the Include Draft Content toggle is off, content from the pages in Draft state will not be shown.
If turned on, make sure you publish all content to prevent broken links.
Select Manually allows you to add one or more content item from the specified content group. The
Select Manually option offers the following functionality:
- Select one or more content items from a content group
- Drag and drop content items in any order
- Search the content group for specific content items
- Select one or more content items
Select one or more content items from your content group to display them in your page.
- Drag and drop
You may drag and drop selected content items to display in a specific order.
- Search for content items
You can search your specified content group for content items.
To clear all content items selected, click the Clear button in the top right corner of the section variable in the Experience Manager sidebar.
Updated 9 months ago