We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36602
    • 8 Posts
    [[getRelated? &returnTVs=`image,videourl` &resource=`` &fields=`tv.tags:1,pagetitle:3` &parents=`3,27,32` &hideContainers=`1` &tplOuter=`relatedtpl` &tplRow=`fTpl`]]


    I'm using
    [[+tv.image]]
    on the row tpl as such:
    <div class="featuredS alt">
                               <a title="[[+longtitle]]" href="[[~[[+id]]]]">
                                  <span class="imgHolder">[[+tv.image:notempty=`<img class="reset" src="[[+tv.image:phpthumbof=`w=340&h=110&f=jpg&zc=1`]]" alt="[[+longtitle:empty=`[[+title]]`]]"/>`]]</span>
                                  <span class="textHolder">
                                        <span class="bg"></span>
                                        <span class="txt">[[+pagetitle]]</span>
                                        <span class="desc">[[+content:stripTags:ellipsis=`45`]]</span>
                                  </span>
                                  <span class="pop"></span>
                               </a>
    </div>


    The image won't display. I'm using the same tpl for a getResources call which displays the image fine. What am I missing?
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      GetRelated doesn't use a tv prefix, just
      [[+image]]
      should do. [ed. note: markh last edited this post 14 years, 7 months ago.]
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 36602
        • 8 Posts
        I swear I tried it without a prefix, but I managed to screw something else up then apparently. Works fine now. Thanks a bunch. Also, this is a great add on that many have waited for - oh so - long!
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Glad you like it!

          FYI, I added a feature to the list to implement a &tvPrefix property so we can get more in line with getResources: https://github.com/Mark-H/getRelated/issues/5
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            New release available:
            1.2.0-pl
            
                [#4] Add &stopwords property to exclude stopwords on a snippet-call basis
                [#6] Properly support multiple (different) snippet calls per page.
                Get rid of the rank (amount of points) in the default tplRow chunk.
                Added support for Russian. Thanks createit!
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 34197
              • 138 Posts
              @Mark Hamstra


              Hi Mark, and thanks for this great plugin.

              The plugin is working fine, but I have just got a little problem, I would like to include the first image of my article into getRelated.

              I have tried to include [[+image]] into the row tpl but with no success ( I am a newbie in Modx)

              Is there an easy way to do it ?
              Do I need to create other chunks or snippet in order to make it work ?

              Thanks

                Webdesigner and musician.
                • 1343 ☆ A M B ☆
                • 2,213 Posts
                Hello,

                What is your getRelated call?
                  Patrick | Server Wrangler
                  About Me: Website | Tweets |  MODX Hosting
                  • 34197
                  • 138 Posts
                  @AMDbuilder

                  Hi, thanks for taking the time to answer.

                  Ok here is what I am using:

                  To call the plugin:
                  [[getRelated? &limit=`5` &tplRow=`getrelatedRow`]]


                  Chunck named "getrelatedRow":
                  <li>
                    <a href="[[~[[+id]]]]" title="[[+longtitle:default=`[[+pagetitle]]`]]">
                      [[+longtitle:default=`[[+pagetitle]]`]] ([[+rank]])
                  [[+image]]
                    </a>
                  </li>


                  Tks
                    Webdesigner and musician.
                    • 1343 ☆ A M B ☆
                    • 2,213 Posts
                    You need to add &returnTVs=`image` to the call for that to work. Granted if your image tv name is something other than image you will need to change it accordingly.
                      Patrick | Server Wrangler
                      About Me: Website | Tweets |  MODX Hosting
                      • 34197
                      • 138 Posts
                      Whao, thanks it worked. I just need to redesign that. But get related work fine now.


                      Thanks for your time again.
                        Webdesigner and musician.