Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Group 1 = Category | Combo Box
Group 2 = Keywords | Tag field
Category Template
Snippet = [[cateName]]
<?php
$get = modX::sanitize($_GET, $modx->sanitizePatterns);
$tag = ucfirst(urldecode($get['categories']));
$tag = str_replace("-"," ", $tag);
$modx->setPlaceholder('cateName', $tag);
Title: [[+cateName]]
Content:
[[!getPage?
&element=`getResources`
&parents=`2`
&limit=`10`
&depth=`0`
&where=`[[!TaggerGetResourcesWhere]]`
&tpl=`blog-list-row`
]]
<h3>Article Tags</h3>
<ul>[[TaggerGetTags? &resources=`[[*id]]` &groups=`2` &rowTpl=`tag_keywords_tpl` &target=`2`]]</ul>
--
<li><a href="[[+uri]]">[[+tag]]</a></li>
--
<h3>Categories:</h3>
[[TaggerGetTags? &groups=`1` &rowTpl=`tag_categories_tpl` &target=`2`]]
--
<p><a href="[[+uri]]">[[+tag]]</a> ([[+cnt]])</p>
--
[[!getResources? &where=`[[!TaggerGetResourcesWhere? &tags=`Books,Vehicles` &where=`{"isfolder": 0}`]]`]]
[[!getResources?
&parents=`-1`
&resources=`[[+model.id]]`
&where=`[[!TaggerGetResourcesWhere? &tags=`sun,women` &matchAll=`1`]]`
&tpl=`shop_sun_women_tpl`
]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.