View Source

\\

h2. getResourcesTag Snippet

This snippet displays the results from a tag link generated by the [tagLister|tagLister.getResourcesTag] snippet.

h2. Usage

Simply place the snippet wherever you would like to display tag-driven Resource lists.

{code}
[[!getResourcesTag? &parents=`4,12,33` &tpl=`tag_result`]]
{code}

See the *Examples* section below.

h2. Available Properties

getResourcesTag is a wrapper snippet around [getResources], so all the properties in [getResources] are also available to getResourcesTag, as well as the following:

||Name||Description||Default||
|tagKey|The TV to filter by.|tags|
|tagRequestParam|The REQUEST parameter to use for the tag filter.|tag|
|grSnippet|The snippet to wrap with getResourcesTag. Recommended to leave at getPage.|getPage|



h3. Common Properties from getResources

Remember: all properties from [getResources] are fair game as arguments to *getResourcesTag*, but in practical usage, you'll probably focus on the following:

|| Name || Description ||
| tpl | Name of a chunk serving as a resource template. If not provided, properties are dumped to output for each resource |
| tplOdd | Name of a chunk serving as resource template for resources with an odd idx value (see idx property) |
| tplFirst | Name of a chunk serving as resource template for the first resource |
| tplLast | Name of a chunk serving as resource template for the last resource |
| sortby | [Any Resource Field|revolution20:Resources#Resources-ResourceFields] (excluding Template Variables) to sort by. Some common fields to sort on are publishedon, menuindex, pagetitle etc, but see the Resources documentation for all fields. Specify fields with the name only, not using the tag syntax.|


h2. Examples

Display Resources with tag 'test' (found in the GET param 'tag') in the TV 'blog-tags', and set the results to a placeholder called 'results':

{code}
[[!getResourcesTag? &parents=`4,12,33` &tagKey=`blog-tags` &toPlaceholder=`results` &tpl=`tag_result`]]

<h2>Search Results</h2>

<ul>
[[!+results]]
</ul>
{code}

Where *tag_result* is a Chunk containing the following:

{code}
<li>
<a href="[[~[[+id]]]]">[[+pagetitle]]</a>
</li>
{code}

h2. See Also

{pagetree:root=tagLister}