<![CDATA[ doesent work when looking for tags with space in between, - MODX Community Forums]]> https://forums.modx.com/thread/?thread=97713 <![CDATA[doesent work when looking for tags with space in between,]]> https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-528452 http://modx.com/extras/package/tagger), so posting my question here.

I'm using this snippets to make a list of related articles. This works well when I'm using one word tags: like: tax, economy, business. But when tags are two words like: global economy, tax low, international business, than snippets doesn't work:
 [[TaggerGetTags? &groups=`1` &resources=`[[*id]]` &rowTpl=`tagName` &toPlaceholder=`taglist` &separator=`,`]]
  [[!getResources?
            &parents=`[[%guidelines.id?  &namespace=`mylex`]],[[%KB.id?  &namespace=`mylex`]],[[%news.id?  &namespace=`mylex`]]`
            &tpl=`related-bottom-list`
            &depth=`0`
            &showHidden=`1`
            &limit=`8`
            &sortby=`{"publishedon":"DESC","createdon":"DESC"}`
            &includeContent=`1`
            &includeTVs=`1`
            &includeTVList=`Img`
            &where=`[[!TaggerGetResourcesWhere? &tags=`[[+taglist]]` &likeComparison=`1` ]]`
            ]] 


As well I will not get any results when tags are in Russian (Cyrillic).

I'm Running Revo 2.3.3, PHP: 5.3.24, MySQL: 5.1.73
Database charset: utf8

Please advice what can be the problem.

]]>
lx Jul 17, 2015, 09:09 AM https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-528452
<![CDATA[Re: doesent work when looking for tags with space in between,]]> https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-552801 Quote from: smg6511v2 at Apr 12, 2016, 11:21 AM
This may have been long-ago solved by this user but, after having run into the same issue, I have the solution to share:

The trouble stems from the fact that there is an undocumented property within the TaggerGetResourcesWhere snippet ("tagField") which is set to "alias" by default. Intuitively, at least for myself and the above user, when generating a [[+taglist]] with the TaggerGetTags call, one would use the [[+tag]] placeholder in their rowTpl (and not [[+alias]]). When the tag is just one word this doesn't matter (unless for some reason you explicitly set a tag's alias to something other than its name), as matching in sql is normally non case sensitive. But multi-word tags such as "Global Economy" would have an alias of "global-economy," thus the mismatch.

Bottom line: Either use [[+alias]] in your TaggerGetTags rowTpl, or set the "tagField" property in your TaggerGetResourcesWhere call to "tag." Arguably the former solution is probably best, as the alias is stripped of spaces and special characters that could potentially muddy up a search.

I just had the same problem, so I added &tagField=`tag` in TaggerGetResourcesWhere to match tags with spaces. Thanks so much!
Someone should really put that in the docs!]]>
stefany Jul 26, 2017, 03:06 PM https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-552801
<![CDATA[Re: doesent work when looking for tags with space in between, (Best Answer)]]> https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-540388
The trouble stems from the fact that there is an undocumented property within the TaggerGetResourcesWhere snippet ("tagField") which is set to "alias" by default. Intuitively, at least for myself and the above user, when generating a [[+taglist]] with the TaggerGetTags call, one would use the [[+tag]] placeholder in their rowTpl (and not [[+alias]]). When the tag is just one word this doesn't matter (unless for some reason you explicitly set a tag's alias to something other than its name), as matching in sql is normally non case sensitive. But multi-word tags such as "Global Economy" would have an alias of "global-economy," thus the mismatch.

Bottom line: Either use [[+alias]] in your TaggerGetTags rowTpl, or set the "tagField" property in your TaggerGetResourcesWhere call to "tag." Arguably the former solution is probably best, as the alias is stripped of spaces and special characters that could potentially muddy up a search.]]>
smg6511v2 Apr 12, 2016, 11:21 AM https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-540388
<![CDATA[Re: doesent work when looking for tags with space in between,]]> https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-528486 http://bobsguides.com/convert-db-utf8.html]]> BobRay Jul 17, 2015, 04:26 PM https://forums.modx.com/thread/97713/doesent-work-when-looking-for-tags-with-space-in-between#dis-post-528486