Knowledge Base

Keyword Search Content

Last Modified:
10 Jul 2020
User Level:
Power User

Description

The Keyword Search Content Navigation Object is used to obtain keywords from a Content Element in the current, parent or specified Section. The keywords are then used to find all Content Items with matching keywords in another specified Content Element.

As an example, if news items are tagged with keywords, you can use the Keyword Search Content Navigation Object to create a listing of all news items with a specific keyword.

To make sure the keywords are entered correctly, you can consider creating a List for the user to select from, rather than allowing the user to enter the keywords as free text.

How to create a Keyword Search Content

To create this object, go to Assets > Navigation and click Create new navigation and select Keyword Search Content.

After completing the standard options used for all types of Navigation Objects, fill in each of the following, where relevant:

ItemDescription
Keyword fetch method

Specify the location of the content that defines which keywords should be used for the search

  • Current section: the content is in the same Section as this Navigation Object
  • Parent section: the content is in the parent Section of this Navigation Object
  • Specified section: the content is within a specific Section
Root section If using Specified section, click Select section, and select the section via Browse or Search
Narrow keyword selection If unchecked, keyword retrieval will use keywords found in all relevant Content Items within the Section to search for matching content in the target section / branch. If checked and the T4 tag appears within a Content Layout or is processed on a full text page, keyword retrieval will be restricted to the currently publishing Content Item. To optimize publish performance, it is best to leave this disabled, unless it is required.
Content type to get keywords Select the Content Type that is used to specify the keywords for which to search (this is not the content you are "tagging") 
Get keywords element name

Select one or more of the Elements which contain the content used for the keyword search.

HTML elements cannot be used for entering keywords.

To optimize publish performance, it may be advisable to add this Element to the System Cache.

Content fetch method

Specify the location of the content containing the keywords. This is the content you have tagged:

  • Specified section: content is always in the same specific Section, or can be determined by the value of a section/content link element within the Content type to get keywords
  • Branch: content is always in the same specific branch, or can be determined by the value of a section/content link element within the Content type to get keywords
  • Use branch at level: content is within the current branch, at a specific level (enter the Start level and End level below)
Search section from

If the Content fetch method is Specified section or Branch select to either:

  • Choose Section: content is always in the same specific Section
  • From Content Element: the location of the content is determined by the value of a section/content link element within the Content Type to get keywords

Keyword Search will not return any results for content that is within a section listed in the "Ignore section names on publish per channel" configuration option.

Search section If using a Specified section or Branch, and choosing a section, select the section via Browse or Search
Start level If using the Content fetch method is Use branch at level, specify the start level, where level 1 is the home (root) section of the channel, regardless of whether Microsites are used or not.
End level If using the Content fetch method is Use branch at level, specify the end level, where level 1 is the home (root) section of the channel, regardless of whether Microsites are used or not.
Name of content element used to determine which section to search from

if From content element is chosen for the Section to search from, select the section/content link element that will determine the Search section.

If this option is used, the T4 tag for the Navigation Object needs to be placed within the Content Layout for the selected Content Type.

To optimize publish performance, it may be advisable to add this Element to the System Cache.

Content type to search keywords

The default setting is Any content type, or select the Content Type where the system searches for matching keywords. This is the content you are "tagging".

Search keywords element name The element(s) to determine the keyword element within the Content Type selected above. To optimize publish performance, it may be advisable to add these Elements to the System Cache.
Number of pieces of content to display The number of Content Items to display. 
Sort type

Select how the content should be ordered (or sort the results by date element, below):

  • Use name (A-Z): Sort the content alphabetically by the Name element A-Z.
  • Use name (Z-A): Sort the content alphabetically by the Name element Z-A.
  • Use last modified: Sort the content by the date that the content was last modified (most recent first).
Sort the results by a date element

Checkbox to order the results according to a date element in the Content Type instead of using the Sort type option above.

If the Only display upcoming content option is checked, content is ordered with the next upcoming dates first (for example, for upcoming events).
If left unchecked, content is ordered with the item furthest in the future listed first (for example, an event occurring in six days will appear before an event occurring in three days).

Only display upcoming content Checkbox to only display content where the date in the content's date element is in the future. Works with the Sort the results by a date element to determine how content is sorted.
Date element name

If using the Sort results by a date element, enter the name of the date element from the Content Type.

Make sure the entry is an exact match and it is a case sensitive entry. If the element is renamed, the original name should be specified.

To optimize publish performance, it may be advisable to add this Element to the System Cache.

Include hidden sections Checkbox to search content within sections that are hidden from navigation.
Allow matching of composite keywords

Checkbox to allow the results to display partial matches so "composite" keywords can be matched to a "single" keyword. This is limited to if the keywords elements are list elements (this is not used for text elements), and would be used where a list element value contains multiple values in a comma-separated list. For example, the list entries are:

  • apple, pear, orange
  • apple
  • pear
  • orange

If the Get keywords element name is "apple, pear, orange" and this option is checked, it then matches any content that is "apple, pear, orange", "apple" or "pear" or "orange". If the Get keywords element name is "apple, pear, orange" and this option is unchecked, it then only matches content that is "apple, pear, orange".

To optimize publish performance, it is best to leave this disabled, unless it is required.

Allow matching on sub-items Checkbox to include content tagged with a taxonomy item's sub-items. For example, if the keywords are entered using a cascading list, selecting a parent option in the list displays all content which matches the parent or the sub-list related to the parent. To optimize publish performance, it is best to leave this disabled, unless it is required.
Enable cross language searching If you have a multi-lingual site, check this box to search content in the other languages. If left unchecked, the object will only search for content in the current language.
Languages to search in If using cross language searching, choose one or more of the available languages.
Before HTML HTML output before the Navigation Object.
After HTML HTML output after the Navigation Object.
Content layouts Use channel default (set on the channel settings) or select alternate Content Layout.
Alternate content layout If the channel default is not used, enter the name of the alternate Content Layout.
Pagination output across pages Check box to paginate the content that is displayed. This automatically creates pagination links to navigate between the pages of content.
Display The number of Content Items you want to display on each page if you use pagination.
Before pagination HTML The code to be output before the pagination links.
Between pagination HTML The code to be output between each pagination link.
After pagination HTML The code to be output after the pagination links.

Review your entries and selections, if you are satisfied with your entries, click Next to generate the object.

Once generated, highlight the T4 Tag Embed Code, copy to your clipboard (Ctrl+C) and paste into a Page Layout or Content Layout. When using a Keyword Search Content Navigation Object, there may be different results, depending on where the object is placed:

  • If a section/content link element is used to determine the location of the tagged content, the T4 Tag for the Navigation Object needs to be placed within the Content Layout for the selected Content Type.
  • If the "Keyword retrieval" content type is the same as the Content retrieval Content Type, the T4 Tag for the Navigation Object needs to be placed within the Content Layout for the selected Content Type (placing it within the Page Layout does not work).

Mirrored Content

In Top Content and Keyword Search Content Navigation Objects, where a Content Item is mirrored into multiple Sections, the Navigation Object will recurse the Branch and only return the first instance of that Content Item. Re-ordering Sections can, therefore, affect the instance of the Content Item that is returned by the Navigation Object.

For Publish to One File Navigation Objects, where a Content Item is mirrored into multiple Sections, the Navigation Object returns all instances of a Content Item.