The {bb_datacollection} module is used to access the content within the specified Data Collection.
This module supports Liquid.
Syntax
{bb_datacollection source="" filter="" sort="" limit="" displayPagination="true" resultsPerPage="" emptyMessage="No items found." collectionName="" layout=""}
Parameters
- source - (Required) This parameter identifies the Data Collection from which to pull the data to render on a web page. If left blank, nothing is rendered on the page or within the code.
- filter - These fields and associated values build a filter string as follows:
filter="fieldname1:myValue1 | fieldname2:myValue2"
Options:- dataId - Filter by the system generated ID.
- Item_Name - Filters the results to one specific item based on the Item Name.
- tags - Filter items according to assigned tags. Separate individual tags with semi-colon. Example: filter="tags:Tag 1;Tag 2"
- dataSubmittedBy - Filter items according to the user who submitted/entered the data collection item
- dataPublishedBetween - Filter items from date and to date.
- random - Filters out a random single item. This parameter doesn't require a name:value pairing. Code example: filter="random"
- custom variables - You can use any custom variable set up in the Data Collection. Spaces in variable names must be replaced with an underscore. For example: a text string "My Variable" and you wanted to filter for items that contain the value of "Red" would be typed in as filter="my_variable:Red"; this would return all the Data Collection items that have the value "Red" in the "My Variable" field.
- sort - These fields can be used for sorting Data Items. Use Ascending and Descending for order direction.
sort="dataName:Ascending"
Options:- dataId
- dataName
- dataPublishDate
- dataSortOrder
- dataComments – displays items with the largest number of comments first. (Future release)
- limit - Set the maximum number of items to return.
- displayPagination - Renders the pagination section when there are more in the data items than the resultsPerPage value.
- resultsPerPage - When displayPagination is set to "true" this number will determine the number of items displayed in a page. Enabled only if displayPagination check box is checked.
- emptyMessage – Your custom value that is rendered. Default text is "No items found.".
- collectionName – Use this parameter to access the Liquid tags. Accessed when layout="" is used.
- showExpired - Accepts a true/false value. This parameter is "false" by default does not show any expired data collection items. Set to "true" if you would like to include items that have expired. (Future Release)
- layout - Renders the module output using:
layout="Default" or layout="List View Layout"
- sets the layout to the Default module layout;layout="My Custom Layout"
- set the layout to use a custom layout template;layout=""
- allows you to code a custom layout right within the web page HTML using Liquid. Ex: {bb_datacollection source="My Collection" layout="" collectionName="myData"} will allow you to use {{myData.Field_Name}}. Switch "Field_Name" with your field names using underscore "_" to replace spaces.
Areas Available
The {bb_datacollection} module tag can be placed within these areas.
- Page Templates
- Web Pages
- Landing Pages
- Content Holders
- Data Collections
Liquid Tags
{{dataName}}
– Name of the data collection item with a hyperlink to the details.{{dataId}}
– System generated ID for the data collection item.{{dataButton | text: “Your Text”}}
– Renders a hyperlink to the collection item details. (Future release){{dataCommentCount}}
– Number of comments for the collection item.{{dataCounter}}
– Incremental count of the items in the data collection returned.{{dataDeleteUrl}}
– Renders the URL that allows the user to delete a data collection item they previously submitted. Only available in a secure zone. (Future release){{dataEditUrl}}
- Renders the URL that allows the user to edit a data collection item they previously submitted. Only available in a secure zone. (Future release){{dataContent}}
– Content of the data collection item.{{dataPublishDate}}
– Date and time the data collection item was published.{{dataExpiryDate}}
– Renders the expiry date to stop displaying the data collection item.{{dataLastUpdated}}
– Displays the date only the data collection item was last updated.{{dataLastUpdatedTime}}
– Displays the time only the data collection item was last updated.{{dataLastUpdatedDateTime}}
– Displays the date and time the data collection item was last updated.{{dataNameNoLink}}
– Name of the data collection item without a hyperlink.{{dataSortOrder}}
– Ordering weight of the data collection.{{dataTags}}
– Renders a list of Tags that this data collection item is assigned to.{{dataUrlWithHost}}
– Full URL of the data collection item including host.{{dataUrl}}
– Relative URL of the data collection item.{{dataDataSource}}
– Used to link two data collections together.{{dataParentId}}
– Used to identify the parent collection connected to the collection.{{dataGeoLocation}}
- Used to identify whether GEO mapping is enabled.{{dataLatLng}}
- Latitude and Longitude of the collection item. Format: (LAT,LONG). If GEO mapping is enabled.{{dataLatitude}}
– Latitude of the collection item. If GEO mapping is enabled.{{dataLongitude}}
– Longitude of the collection item. If GEO mapping is enabled.{{dataAddress1}}
– Street address of collection item. If GEO mapping is enabled.{{dataAddress2}}
– Additional street address line for the collection item. If GEO mapping is enabled.{{dataCity}}
– City of collection item. If GEO mapping is enabled.{{dataState}}
– State of the collection item. If GEO mapping is enabled.{{dataZipCode}}
– Zip code of the collection item. If GEO mapping is enabled.{{dataCountry}}
– Country of the collection item. If GEO mapping is enabled.