Skip to content

Instantly share code, notes, and snippets.

@dubrod
Created November 30, 2018 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dubrod/5d6933619e1b40eae15d1b4e3d7b4a38 to your computer and use it in GitHub Desktop.
Save dubrod/5d6933619e1b40eae15d1b4e3d7b4a38 to your computer and use it in GitHub Desktop.
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