We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36671 ☆ A M B ☆
    • 120 Posts
    I'm trying to use pdoTools for the first time. pdoMenu working fine. Now on to pdoResources. My call is working fine except for TVs not returning. Here's my code:


    Template Variables in question:

    project-type (Listbox-Single, Options: SME & Food Business Consulting/Mentoring==mentoring||Product Development==product-development||Feasibility Study==feasibility-study||Innovation & Funding==innovation-funding||Business Network Facilitation==business-network||Other==other)

    project-image (coming from a media source at assets/uploads/)


    portfolioItemTpl:

    <div class="span3 portfolio_item block [[+tv.project-type]]">
                      <div class="view view-first">
                           <a href=""><img src="[[phpthumbsup? &input=`assets/uploads/[[+tv.project-image]]` &options=`w=270&h=187`]]"></a>
                           <div class="descr">
    				<h5><a href="">[[+pagetitle]]</a></h5>
    				<p class="clo">[[+longtitle]]</p>
    		       </div>
    		</div>
                </div>



    Call:

    [[!pdoResources?
    &parents=`[[*id]]`
    &sortby=`RAND()`
    &tpl=`portfolioItemTpl`
    &includeTVs=`product-type,product-image`
    &processTVs=`1`
    ]]




    I tried replacing pdoResources with getResources (also installed) but then it returns nothing at all! At least with pdoResources, I get the chunk, it just doesn't generate the image or the project-type class.

    Any idea where I'm going wrong. And why the getResources version isn't working at all? Thank you!!!
      • 37242 ☆ A M B ☆
      • 339 Posts
      If it works like getResources it should work like this:

      [[!pdoResources?
      &parents=`[[*id]]`
      &sortby=`RAND()`
      &tpl=`portfolioItemTpl`
      &includeTVs=`1`
      &includeTVlist=`product-type,product-image`
      ]]

      Its either "TVs : yes or no" or "TVlist : this, that and that document"
        • 36573
        • 173 Posts
        Try adding &tvPrefix=``
          Everything I know I learned on the internet. Saved me thousands in College tuition,
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          With pdoResources, includeTVs takes a comma-separated list of TV names, not just a 1/0 boolean condition. It does not have the tvlist property.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 36671 ☆ A M B ☆
            • 120 Posts
            Well, now I'm embarrassed! After trying out the various suggestions but nothing was either applicable or helped fix it, I asked my darling brother to cast another eye over the whole thing and guess what he spotted?

            [[+tv.project-type]]
            [[+tv.project-image]]

            &includeTVs=`product-type,product-image`

            It would help if I had used the same tv names throughout my code ..... Feeling rather stupid now. Apologies for wasting everybody's time. Eek!