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

    I have this code:

    [[If?
       &subject=`[[*tt.ison]]`
       &operator=`EQ`
       &operand=`Ja`
       &then=`
       		
        <div class="top-topic-card top-spacer">
          <div class="container">
             <h3 class="tt"><span class="tt-label">Top-Topic</span></h3>
               <h4 class="tt">[[*tt.titel]]</h4>
                <div class="row">
    
                 [[pdoResources?
                   &limit=`4`
                   &includeContent=`1`
                   &prepareTVs=`1`
                   &processTVs=`article.picture`
                   &includeTVs=`article.portal,article.start,article.kategorie,article.picture,article.hascolor,article.label`
                   &resources=`[[*tt.articles]]`
                   &tpl=`tpl.post-tt`
                 ]]
    
           </div>
          </div> 
       </div>
       
    `]]


    The thing is, that the PDOresources-call will do nothing.
    Is is not possible within a IF?

    I got the same result when I try it with:

    [[*tt.ison:is=`Ja`:then=`...
    [ed. note: ichris89 last edited this post 9 years, 1 month ago.]
      • 4172
      • 5,888 Posts
      Did you test every part alone? The output-filter, the if-snippet, the getResources - call?
      The TVs, if the show, what they should?

      Also, using dots within element-names might not be the best idea. [ed. note: Bruno17 last edited this post 9 years, 1 month ago.]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 49710
        • 92 Posts
        Hi,

        I tested this alone, and it works:

        [[pdoResources?
                       &limit=`4`
                       &includeContent=`1`
                       &prepareTVs=`1`
                       &processTVs=`article.picture`
                       &includeTVs=`article.portal,article.start,article.kategorie,article.picture,article.hascolor,article.label`
                       &parents=`7`
                       &resources=`36`
                       &tpl=`tpl.post-tt`
                     ]]


        The changes: I give it a &parents=`7`, so it runs as "standalone".
        But within the IF it outputs the call itself. Not the result of the call.
          • 4172
          • 5,888 Posts
          what, if you put the whole thing into a chunk and use it like that?

          [[[[If?
             &subject=`[[*tt.ison]]`
             &operator=`EQ`
             &operand=`Ja`
             &then=`$theChunk`
          ]]]]
          


          theChunk:

                   
              <div class="top-topic-card top-spacer">
                <div class="container">
                   <h3 class="tt"><span class="tt-label">Top-Topic</span></h3>
                     <h4 class="tt">[[*tt.titel]]</h4>
                      <div class="row">
           
                       [[pdoResources?
                         &limit=`4`
                         &includeContent=`1`
                         &prepareTVs=`1`
                         &processTVs=`article.picture`
                         &includeTVs=`article.portal,article.start,article.kategorie,article.picture,article.hascolor,article.label`
                         &resources=`[[*tt.articles]]`
                         &tpl=`tpl.post-tt`
                       ]]
           
                 </div>
                </div> 
             </div>
          



          does the standalone pdoResources also work with your

          [[*tt.articles]]
          


                       [[pdoResources?
                         &limit=`4`
                         &includeContent=`1`
                         &prepareTVs=`1`
                         &processTVs=`article.picture`
                         &includeTVs=`article.portal,article.start,article.kategorie,article.picture,article.hascolor,article.label`
                         &resources=`[[*tt.articles]]`
                         &tpl=`tpl.post-tt`
                       ]]
          
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 49710
            • 92 Posts
            Hi,

            I tryed ist like you say with:
            [[[[If?
               &subject=`[[*tt.ison]]`
               &operator=`EQ`
               &operand=`Ja`
               &then=`$theChunk`
            ]]]]


            But this won't work. The if query is not processed.

            Hm....standalone it won't work with [[*tt.articles]]....funny.
              • 4172
              • 5,888 Posts
              what outputs [[*tt.articles]] alone?
              The If - snippet is installed and works standalone?
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 49710
                • 92 Posts
                [[*tt.articles]] Outputs 36 - that is alright.

                Yes, the if-Snippet (Standalone without the pdoResources) works.
                  • 49710
                  • 92 Posts
                  This work as standalone as well:

                  [[pdoResources?
                    &limit=`4`
                    &includeContent=`1`
                    &prepareTVs=`1`
                    &processTVs=`article.picture`
                    &includeTVs=`article.portal,article.start,article.kategorie,article.picture,article.hascolor,article.label`
                    &resources=`[[*tt.articles]]`
                    &tpl=`tpl.post-tt`
                  ]]


                  Without the parent it won't.
                    • 49710
                    • 92 Posts
                    I mean the IF Snippet (Standalone) my version (see first Post) run, without the PDOResources.

                    Your Version:

                    [[[[If?
                       &subject=`[[*tt.ison]]`
                       &operator=`EQ`
                       &operand=`Ja`
                       &then=`$theChunk`
                    ]]]]


                    do not processing.
                      • 4172
                      • 5,888 Posts

                      Without the parent it won't.

                      yeah, I think you need a parents
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!