We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10362
    • 2 Posts
    Hi folks,

    I have a problem with the different behaviour of TagLister and getResourcesTag (Revo 2.1.3, tagLister 1.1.3).

    Scenario: A TV with the input type ’text’ and the output type ’Delimiter’ holds all the tags of the resource.

    TagLister correctly explodes the TV value to get the individual tags, but getResourcesTag doesn’t. Depending on what I set ’&tagSearchType’ to, getResourcesTag either outputs nothing or a whole lot of resources whose TV value just happens to contain the search string. I.e, if the tag I’m looking for is ’mate’, getResourcesTag also outputs resources tagged with ’material’ or ’amateur’.

    Maybe this is just a matter of redefining the ’tagSearchType’ property in the getResourcesTag snippet?
    $scriptProperties[’tvFilters’] = $tagKey.’==%’.$tag.’%’

    Can anyone point me in the right direction? Or at least tell me definitively that there is no solution to my problem?

    Thanks for whatever help you can give me.



    Update:
    OK, the above idea was dumb (inspired by desperation). But does really no-one have any idea how to work around this problem?

    To elaborate: I need this for a dictionary site. Each document ’is’ a German term with three TVs: 1: German synonyms, 2: English translations and 3: Russian translations. Three index pages list the German, English, and Russian expressions (tags) respectively, where each link opens the document the tag is associated with. Or rather, it should open this and only this document. But getresourcesTag refuses to do that.

    This system works perfectly in Evolution, as you can see here: http://www.ueber-setzen.com/de/fundgrube/typographie/deutsches_stichwortverzeichnis.html. But I cannot figure out how to recreate it in Revolution.
      Den fr
    • Quote from: Wortbastler at Aug 10, 2011, 08:01 AM

      $scriptProperties[’tvFilters’] = $tagKey.’==%’.$tag.’%’;
      With $tag="fun" this translates per default to:
      $scriptProperties['tvFilters'] = 'tags==%fun%';


      The "%" is for MySQL what "*" is for other systems: a placeholder for "anything". So "%fun%" will also find any subset like "fundamental", "refunds", "unfun" etc.

      If you alter the snippet (duplicate and rename first!) you might want to place this php code to do an exact search:
      $scriptProperties['tvFilters'] = $tagKey.'=='.$tag;


      Hope that helped!?

      Oliver
        MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
        http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
        • 10362
        • 2 Posts
        Hi Oliver,

        changing the search parameter was the first thing I tried. But it didn’t solve my problem because the TV value is actually a list of comma-separated values. In some cases it is as simple as ’fun’, but in others it is something like ’fun, joke, lark, jest’.

        So when getResourcesTag does an exact search for the tag ’fun’, it won’t find anything because ’fun, joke, lark, jest’ doesn’t match ’fun’.

        After reading everything I could find on getResources, tagLister, and related packages like migx, I fear there is no ready-made solution to my problem. And writing one myself is far beyond me. So I will just have to stick with Evolution.

        But thanks for your time anyway.

        Gabi
          Den fr
        • Quote from: Wortbastler at Aug 13, 2011, 11:40 AM

          So when getResourcesTag does an exact search for the tag ’fun’, it won’t find anything because ’fun, joke, lark, jest’ doesn’t match ’fun’.
          After reading everything I could find on getResources, tagLister, and related packages like migx, I fear there is no ready-made solution to my problem. And writing one myself is far beyond me. So I will just have to stick with Evolution.
          Well, you could use a snippet that converts your comma separeted list "fun, joke, lark, jest" into a MySQL statement and pass that over to getResourcesTag. How are the tags stored in MySQL DB?

          Oliver

          P.S.: Revolution rocks!!!
            MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
            http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
            • 10362
            • 2 Posts
            Thanks for trying, Oliver.

            The TV key is stored in site_tmplvars, the tags themselves in the ’value’ field of the site_tmplvar_contentvalues table.

            Gabi

            (Revolution rocks? I’m sure it does. But it requires a much deeper understanding of programming matters than Evolution.)
              Den fr
              • 10362
              • 2 Posts
              At the very beginning of my search for a solution, I came upon this comment by OpenGeek:

              If you have multiple possible values, you have to use tags==%Events% and make sure you don’t have any other tags container the word Events.

              (http://modxcms.com/forums/index.php/topic,57500.0.html)

              I didn’t want to believe this statement because it contradicts the very nature of tags, which are specific keywords, not general categories. In a fine-tuned tagging system, you will always have several tags containing the same words. For example, on my translation blog I have 7 tags containing the word ’translation’, each of them dealing with a different and distinct aspect of translation.

              But now I have to believe that the statement is actually true and what I need to do cannot be done in Revolution. At least not by a non-programmer. I admit defeat.

              Gabi
                Den fr
              • please post a bug report or feature wish at http://bugs.modx.com or contact jason directly.

                Oliver
                  MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
                  http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
                  • 37486
                  • 4 Posts
                    • 5290
                    • 29 Posts
                    It's been a year and a half since this thread was active, but if anyone is still interested I've posted a new post explaining the problem in detail and suggesting 2 workarounds and a permanent solution here: Why tagging doesn't work in Revo and how to solve this. I've also entered a refactor request here: #9493
                      A computer program is a utilitarian typographer's dream - a functioning machine composed completely of type. (John Maeda)
                      • 25910
                      • 26 Posts
                      Hi folks,

                      here my solution:
                      install the last TagLister package.
                      use [[!getResourcesTag? &tagSearchType=`within` &yourParametersHere... ]]

                      Then you have to modify the getResources 1.6.0 to work with the (IN) operator. Please check my fork on github: https://github.com/enzyms/getResources

                      Hope it helps!