Query By Shared Tag

You can use this query type to get content items that are tagged with the same tags as the current content item. A query of this type returns any content item that has at least one tag in common with the current content item. You can, however limit the number of content items returned by specifying a minimum tag relevance.

This query type should only be used in content item templates. If you use a query of this type in a section page template then it will never return any results, since a section URL does not provide a current content item.

The Query by shared tag form contains the following fields:

Section selection mode

The value you select here determines both how the Section field operates and how the value you enter in the Section field is used. The following options are available:

Publication-specific

If you select this option, then the Section field lets you choose a specific section belonging to a specific publication. The query will then always select content items from this specific section.

Context-dependent

If you select this option, then the Section field lets you choose a section without reference to which publication it belongs to. The query will then select content items from the selected section in the current publication (that is, the publication named in the request URL).

For the Context-dependent option to be useful, your publications must include sections that have both identical titles and identical unique names.

Minimum relevance

Specifies the minimum relevance a tag must have in order to be used in the query. Relevance is a value between 1 and 5 that indicates how relevant the tag is to a content item. Relevance can also be used as a sort criterion for the content items returned by this query - see the description of the Sort by field below.

Section

The name of the section you are interested in. Once you start typing, a drop-down menu is displayed containing a list of all sections that match the characters you have typed. You will see that the way the section titles are listed depends on the option you selected in the Section selection mode field.

If you do not specify a section, then Section selection mode is ignored, and content items are selected from the current section of the current publication (that is, the publication and section named in the request URL).

Include subsections

Yes means content items will be selected from the specified section(s) and all of its/their subsections. No means content items will only be selected from the specified section(s)

Content types

The names of the content types you want to be selected. Once you start typing, a drop-down menu is displayed containing a list of all content types that match the characters you have typed. Select the content type you are interested in. The selected name is then displayed as a token in the field. You can repeat this process to enter many content types.

Start date

A start date for selecting content items by date. Only content items published on or after this date will be selected.

There is another Start date setting on the Filter & sort tab that is applied to the total result set returned by all your queries. If set, it can potentially override this setting. See Filter & sort for details.

End date

An end date for selecting content items by date. Only content items published on or before this date will be selected.

There is another End date setting on the Filter & sort tab that is applied to the total result set returned by all your queries. If set, it can potentially override this setting. See Filter & sort for details.

Sort by

The sort option you require. Note that the sort option here includes a score option. This option sorts the content items on a relevance score based on:

  • How many matching tags the returned content item has

  • The relevance of those matched tags to the current content item (relevance is a parameter that can be set when a tag is added to a content item).

Each returned content item's score is calculated by adding together the relevance of all its matching tags. The content items are sorted with the highest score first.

The option you select here will be overridden by any sort option specified on the Filter & sort tab unless you switch it off. See Filter & sort for details.

Maximum items

The maximum number of content items you want to be selected by this query.

There is another Maximum items setting on the Queries tab that is applied to the total result set returned by all your queries. If set, it can potentially override this setting. See Queries for details.