Keyword Search Content
- Last Modified:
- 18 Apr 2019
- User Level:
- Power User
The Keyword Search Content Navigation Object is used for obtaining keywords from a Content Type Element in the current, parent or specified Section, storing these keywords and then using them to find all content with matching keywords in another specified Content Type 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:
|Keyword fetch method||
Specify the location of the content that defines which keywords should be used for the search
|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.|
|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.
|Content fetch method||
Specify the location of the content containing the keywords. This is the content you have tagged:
|Search section from||
If the Content fetch method is Specified section or Branch select to either:
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.|
|End level||If using the Content fetch method is Use branch at level, specify the end level.|
|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.
|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|
|Number of pieces of content to display||The number of Content Items to display.|
Select how the content should be ordered (or sort the results by date element, below):
|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).
|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.
|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:
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".
|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.|
|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).
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.