You haven’t defined a template for display. I’d also move the &element and &elementclass params to the top, as sometimes add-ons can be picky about the order of parameters.
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
Change the Tpl chunk to this:
<li><a href="[[~[[+id]]]]">[[+pageTitle]]</a></li>
and make sure you have a [[$ChunkName]] tag in the resource with the getResources tag or you won’t see any results.
When setting up a new snippet call, it’s best not to try to do everything at once, so you might consider just taking the &toPlaceholder parameter out for now, simplifying &parents, and putting this in the Resource Content field:
<div id="related">
<h4 class="light">Related</h4>
<ul>
[[!getResourcesTag?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`0`
&depth=`10`
&includeContent=`0`
&includeTVs=`1`
&showHidden=`0`
&hideContainers=`0`
&tpl=`relatedContentItem`
]]
</ul>
</div><!--close related-->
I may be getting the wrong end of the stick here, but I don’t think you’re setting a condition at all - at present you’re just asking it to return all resources that have the ’tags’ field populated.
(To answer your other question, afaik, the tags input option is simply a speedier way of getting text into that field - at a base level they’re both text input fields. However, it is pretty nifty, and I use it on keywords style fields, where you want to keep consistency, but don’t need the rigour of a list).
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
What you’re trying to do is fairly complex for a beginning MODx user. The getResourcesTag snippet calls the getPage snippet (for pagination), which in turn calls the getResources snippet.
I’ve never used this, but it appears that the tag you want to show must be sent in as a $_GET variable, either in the URL of the page with the getResourcesTag tag or from a form that posts to that page using the "get" method. I believe your snippet tag is correct, though. When getResources doesn’t understand the search criteria or they are missing, it tends to show every resource under the &parents that’s published and not hidden from menus.
Bob may know better, but it sounds like in that example a url ending in ?tags=test would look for the value ’test’ in the tv ’blog-tags’.
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
Quote from: odeclas at Feb 02, 2011, 02:13 PM
Bob may know better, but it sounds like in that example a url ending in ?tags=test would look for the value ’test’ in the tv ’blog-tags’.
That should work, but every page with a link to the current page would have to have that special URL.
If might work to put a snippet call at the top of the page (above the getResourcesTag tag) like this:
/* SetTag snippet code */
$_GET['tags']='test';
return '';
As I say, I’ve never used that snippet so I’m guessing here and there may be an easier way.