Query language is a powerful way to select content by writing search queries based on a number of options. The query is only used for display purposes in a number of Thought Industries widgets.
Use Case Information
If you have a lot of content, or want to highlight particular pieces of content in your catalog, you can use our query language to dynamically determine what content should appear. For example, you can query by tags, custom fields, content types, and other fields available in the Thought Industries platform.
When configured you can control the following:
- Display default content in Catalogs
- Exclude content types where necessary
- Dynamically control content widgets
- Promote featured content
Writing a Query
In its most simple form, a query will be made up of two pieces. The first is the query type, while the second is the value. An example would be in the form of Type:Value
, where "Type" and "Value" would be represented as information from the Thought Industries platform.
A common example is to use tags to dynamically display content. The query could look like this tags:example
. In this example, "tags" is the query type to be called and "example" is the value descriptor. The outcome would show only content tagged with "example".
Note
Tagging is a way to organize your content. For example, if your content is location based, you could use the tags to highlight where the piece of content is. The exact tagging taxonomy is up to each individual learning site.
If you wish to learn more about tagging, please visit this article: Using Tags to Organize Content
Other conditions can be added to your queries which will impact the results that may appear. Examples of these other conditions are the AND
operator, OR
operator and the (minus) -
operator.
AND Operator
AND Operator is used to test for two or more queries. All conditions must be met to dynamically display content. An example could look like this Type:Value AND otherType:otherValue
.
OR Operator
OR Operator is used to test for multiple queries. Any one of the conditions must be met to dynamically display content. An example could look like this Type:Value OR otherType:otherValue
.
Note
The AND
operator and OR
operator must be capitalized to be queried. If you do not have all letters in the operator as capitalized it will not work correctly.
- Operator
- Operator is used to exclude a query. It must be placed at the start of the query and can be used in conjunction with the AND operator and OR operator. An example could look like this -Type:Value
.
Example Queries
These examples of query language are all based on Thought Industries fields. You can search by tags, content types, custom fields, sources, authors and more. Most of the "Values" are customizable by you and your team so we recommend having a planned structure before creating these values.
Note
Custom Content Fields will require you to create custom "Types" and "Values", while the "Types" for majority of other queries are preset by Thought Industries nomenclature.
- The most popular way to select content is by tag. To select all content that has an example tag of “Premium Package” you can use the following query:
tags:"Premium Package"
- You can write queries for Content Type. This will allow you to create many curated catalogs or featured content widgets and is a great way to promote certain content. For example,
contentType:"Learning Path"
- or
contentType:videos
- Custom Content Fields can also be used to write queries. You will use the dasherized version of the label for the query. This dasherized label is displayed on the list of custom fields. For example,
difficulty:Easy
- or
recipe-type:Breads
- You can also find content by authors and source, if applicable. You will need to add Authors and Sources to your content to be able to use these fields. For example,
source:"Adams LLC"
- or
authors:"Douglas Adams"
- Also note, Multiple terms can be grouped together with parentheses to form sub-queries. For example,
(tags:"Premium Package" OR tags:"Silver Package")
Note
Quotations will be needed around any Values that contain a space (e.g., tags:yellow, tags:"yellow package").
Available Query Locations
The Thought Industries Platform has many locations to use queries. From default settings for all Catalog widgets, to customizing individual widgets, you will be able to use queries to control your user experience with great detail. The following locations allow you to add queries:
- Catalog Settings
- Individual Catalog Widget
- Featured Content Tiles
- Featured Content Carousel
- Image Overlay Tiles
- About Blocks
- Hero Image Slider
- Link Lists
- Navigation Bar Widget
- Learner Access Widget
- Navigation Links
Catalog Settings
The Catalog settings can found under Settings > Organization & Display > Catalog section - Advanced.
Find Default Content and click on Write Search Query to add the queries that match your content. The outcome will be a default of what content displays in all catalog widgets, unless configured individually.
Individual Catalog Widget
The Individual Catalog Widget settings can found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
Turning on Customize Settings will present two options. The first will be Content to Display in Widget. To use this, click Write Search Query to add the queries that match your content. This will filter out all content not selected for display from the widget entirely, including custom content fields.
The second option will be to set Default Content. This option is found at the bottom of the Catalog widget settings. To use this, click Write Search Query to add the queries that match your content. Only content included in this query will display when users are not actively searching or filtering in this widget. This will not affect the content accessible through searching and filtering.
Featured Content Tiles
The Featured Content Tiles is a widget focused on displaying specific or promoted content and comes in two forms - Standard and Descriptive. It can be found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use queries in this widget you must select Dynamically Display Content from the content type drop-down. Click Write Search Query to add the queries that match your content. This will only populate content based on the query added.
Featured Content Carousel
The Featured Content Carousel is similar to the featured content tiles in its purpose, but adds a carousel feature. It can be found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use queries in this widget you must select Dynamically Display Content from the content type drop-down. Click Write Search Query to add the queries that match your content. This will only populate content based on the query added.
Image Overlay Tiles
The Image Overlay Tiles is similar to the featured content tiles, but has a slightly different style. It can be found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use queries in this widget you must select Dynamically Display Content from the content type drop-down. Click Write Search Query to add the queries that match your content. This will only populate content based on the query added.
About Blocks
The About Blocks is a navigation style widget that allows you to add images, icons, and links to other locations. It can found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use queries in this widget, first create a block by selecting Add item . Upon creation you will see an option for Link To. Queries are only supported for the catalog option. Click Write Search Query to add the queries that match your content. Add a query label and select Set Catalog Query. The outcome will be a navigation item that will direct learners to the catalog page with a preset filter in place based on the query parameter.
Hero Image Slider
The Hero Image Slider is similar to the featured content tiles because you can populate and promote content, but it is in a hero image format. It can be found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use queries in this widget you must select Dynamically Display Content from the content type drop-down. Click Write Search Query to add the queries that match your content. This will only populate content based on the query added.
Link Lists
The Link Lists is a navigation style widget that allows you to add links to other locations. It can found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use queries in this widget, first create a link list by filling in a link list label and selecting Add Link List. Next you need to select + Add Link. Upon creation you will see an option for Link To. Queries are only supported for the catalog option. Click Write Search Query to add the queries that match your content. Add a query label and select Set Catalog Query. The outcome will be a navigation item that will direct learners to the catalog page with a preset filter in place based on the query parameter.
Navigation Bar Widget
The Navigation Bar is a navigation style widget that allows you to add links to other locations. It can found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use queries in this widget, first create a link by selecting Add Link . Upon creation you will see an option for Link To. Queries are only supported for the catalog option. Click Write Search Query to add the queries that match your content. Add a query label and select Set Catalog Query. The outcome will be a navigation item that will direct learners to the catalog page with a preset filter in place based on the query parameter.
Learner Access Widget
The Learner Access Widget highlights all of the content a learner has started or completed. It can be found under Design > Layouts > Any page building Layout (eg. Catalog or Dashboard).
To use this, click Write Search Query to add the queries that match your content. The outcome will be that the access widget will only show started and completed content based on the query parameter.
Navigation Links
The Navigation Links is the default navigation that allows you to add links to other locations. It can found under Design > Theme > Navigation Links.
To use queries in this widget, first create a link by selecting Add Link . Upon creation you will see an option for Link To. Queries are only supported for the catalog option. Click Write Search Query to add the queries that match your content. Add a query label and select Set Catalog Query. The outcome will be a navigation item that will direct learners to the catalog page with a preset filter in place based on the query parameter.