We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts
    All is well in MIGX land, except new entries.

    I have about 20 items, that work just fine. The tpl is a little complicated with some If logic to make it display properly, but it works just as intended. Now come these two new entries which are outside of all the If conditions and just display a link. The [[+image]] placeholder doesn't output the path, but rather "--", only just for these new items.

    i.e.
    <figcaption>
    <h4>
    <a target="_blank" alt="Spider" href="--">Spider</a>
    </h4>
    <p> </p>
    <p> photography </p>
    </figcaption>



    Here's the tpl, if it helps. Any ideas?

    <li class="span3 filter-[[+category]]">
                    <figure class="round-box box-huge no-rounded">
                      <a class="box-inner fancybox[[!If? &subject=`[[+media]]` &operator=`EQ` &operand=`1` &then=`-media`]]" href="[[!If? &subject=`[[+vimeoURL]]` &operator=`notempty` &then=`[[+vimeoURL]]` &else=`[[!If? &subject=`[[+pressPDF]]` &operator=`notempty` &then=`[[!+image:default=`[[+pressPDF:phpthumbof=`wp=610&f=jpg`]]`]]` &else=`[[+image:phpthumbof=`w=600&f=jpg&zc=1`]]`]]`]]" alt="[[+title]]" rel="group" title="[[+title]]"/>
    
                        <img class="img-circle" src="[[+image:phpthumbof=`w=300&f=jpg&zc=1`]]" alt="[[+title]]" title="[[+title]]">
                        <i class="plus-icon"></i>
                      </a>
                      <figcaption>
                       [[!If? &subject=`[[+pressPDF]]` &operator=`notempty` &then=`<h4><a href="[[+pressPDF]]" title="[[+title]] alt="[[+title]]" target="_blank">View [[+title]] Press Release (pdf)</a></h4>` &else=``]] 
                       [[!If? &subject=`[[+vimeoURL]]` &operator=`notempty` &then=`<h4><a href="[[+vimeoURL]]" alt="[[+title]]" target="_blank">[[+title]]</a></h4>` &else=``]]
                       [[!If? &subject=`[[+vimeoURL]]` &operator=`empty` &then=`[[!If? &subject=`[[+pressPDF]]` &operator=`empty` &then=`<h4><a href="[[+image]]"  alt="[[+title]]" target="_blank">[[+title]]</a></h4>` &else=``]]`]]                                
                        <p>[[+text]]</p>
                        <p>[[+category]]</p>                  
                          [[!if? &subject=`[[+new]]` &operator=`EQ` &operand=`1` &then=`<span class="tag">NEW</span>`&else=``]]
                       
                      </figcaption>
                    </figure>
                  </li>

      Frogabog- MODX Websites in Portland Oregon
      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
      Having server issues? These guys have MODX Hosting perfected - SkyToaster
      • 4172
      • 5,888 Posts
      try

      [[!If? &subject=`[[+vimeoURL]]` &operator=`ne` &operand=`--` &then=`<h4><a href="[[+vimeoURL]]" alt="[[+title]]" target="_blank">[[+title]]</a></h4>` &else=``]]


      better would be, to have different chunks for each different output and not using this conditionals. [ed. note: Bruno17 last edited this post 13 years, 3 months ago.]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Unfortunately, I am unable to get the @field:tpl to work. This is the second time I've tried it on this project. Made the TV, the chunks, edited every single item in MIGX and it blows out an array as if the tpl doesn't exist.

        Same as last time I did it. What gives?

          [[!getImagelist? &tvname=`portfolioMIGX` &tpl=`@field:itemTpl`]]


        tpl tv inputs:
        Press PDF==pressTpl||Media==mediaTpl||Photography==photoTpl
        [ed. note: frogabog last edited this post 13 years, 3 months ago.]
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          The tv for the tpl field seems to be working properly, as noted below ([itemTpl] => pressTpl)


          Array
          (
              [MIGX_id] => 10
              [title] => Frank Sinatra Jr.
              [text] => 
              [fullDescription] => 
              [category] => press
              [new] => 0
              [pressPDF] => /assets/personal/images/press_releases/sinatra-pr.pdf
              [media] => 0
              [vimeoURL] => --
              [itemTpl] => pressTpl
              [image] => /assets/personal/images/thumbnails/Sinatra New.jpg
              [image2] => 
              [useImage2] => 
              [_alt] => 1
              [_first] => 
              [_last] => 
              [idx] => 4
              [property.tvname] => portfolioMIGX
              [property.tpl] => @field:itemTpl
          )
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 4172
            • 5,888 Posts
            if the name of your tpl-field is itemTpl try:

            [[!getImagelist? &tvname=`portfolioMIGX` &tpl=`@FIELD:itemTpl`]]


            @FIELD = uppercase
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Could be it's case-sensitive, @FIELD instead of @field
                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
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Figured it out; the field's value has to be a chunk name, @CODE:... etc, exactly what you would put in the &tpl 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
                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  OK! @FIELD works great!

                  Thank you so much. Argh, what a pita, I totally chucked the idea of multiple tpl's 2w ago after going round and round with the @field:tpl property. Sure makes variable output with MIGX much easier.

                  Looks like the docs have been changed already. I suspect you Susan :~}
                    Frogabog- MODX Websites in Portland Oregon
                    "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                    Having server issues? These guys have MODX Hosting perfected - SkyToaster
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Yep. Ryan may recall that my first actual MODx login (other than for the forums) was for editing documentation; the proliferation of it's for its was making me crazy (and certain persons whose names I shall not mention are still doing it).
                      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