We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36686
    • 165 Posts
    My sites' error logs are getting clogged up with these kinds of errors, which I've traced down to the link conditionals in this chunk:

    <div class="feature-column one-third column">
    	[[+link:isnot=``:then=`<a href="[[~[[+link]]]]" class="preload">`]]<img src="[[+bild:phpthumbof=`w=640&h=320&zc=1&q=95`]]" alt="[[+rubrik]]" class="scale-with-grid" />[[+link:isnot=``:then=`</a>`]]
    	<h4>[[+rubrik]]</h4>
    	[[+text]]
    	[[+linkText:isnot=``:then=`<a href="[[~[[+link]]]]" class="button">[[+linkText]]</a>`]]
    </div>


    What would the correct way to put this together without getting an error message in the log every time someone enters the page? Apart from the error message the links are working the way I want them to.
      • 16348
      • 64 Posts
      Does the placeholder link contain a number (page id) or does it contain a URL?
      If it does contain a URL you don't need the modx link tag. Try this in that case:
      <div class="feature-column one-third column">
          [[+link:isnot=``:then=`<a href="[[+link]]" class="preload">`]]<img src="[[+bild:phpthumbof=`w=640&h=320&zc=1&q=95`]]" alt="[[+rubrik]]" class="scale-with-grid" />[[+link:isnot=``:then=`</a>`]]
          <h4>[[+rubrik]]</h4>
          [[+text]]
          [[+linkText:isnot=``:then=`<a href="[[+link]]" class="button">[[+linkText]]</a>`]]
      </div>
      
        • 36686
        • 165 Posts
        Quote from: Kristoffer at May 02, 2013, 07:39 AM
        Does the placeholder link contain a number (page id) or does it contain a URL?
        If it does contain a URL you don't need the modx link tag. Try this in that case:

        The link placeholder is set in MIGX by picking a resource in a resource list. It only outputs a number (a page id), so I need the [[~]] in the chunk.
          • 3866 ☆ A M B ☆
          • 350 Posts
          Did you ever get to the bottom of this one? As I'm experiencing the same issue on a couple of my sites.

          [[If?  &subject=`[[+link]]`  &operator=`notempty`  &then=`<a href="[[~[[+link]]]]" title="[[+title1]]"><img src="[[+image1]]" alt=""/></a>` &else=`<img src="[[+image1]]" alt=""/>`]]


          Have also tried:

          [[+link:is=``:then=`<img src="[[+image1]]" alt=""/>`:else=`<a href="[[~[[+link]]]]" title="[[+title1]]"><img src="[[+image1]]" alt=""/></a>`]]


          This is being used in conjuction with a MIGX call

          [[!getImageList?   &tvname=`imageGroup`   &tpl=`4square-imagesTpl`]]


          Running on a 2.2.14 Revo site.
          MIGX Version 2.6.8
          If Version 1.1.1

          Suggestions please smiley
            Helen Warner
            Number one pixel!
            Proud to be linked with MODX at Crimson Pixel
            • 4172
            • 5,888 Posts
            modx will parse the makeUrl - tag, also when [[+link]] is empty.

            Try it this way:

            [[+link:is=``:then=`
            <img src="[[+image1]]" alt=""/>
            `:else=`
            <a href="[[[[+link:isnot=``:then=`~[[+link]]`:else=``]]]]" title="[[+title1]]"><img src="[[+image1]]" alt=""/></a>
            `]]


            This is working from inside to outside and should generate the makeUrl - tag, only when [[+link]] is not empty
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 3866 ☆ A M B ☆
              • 350 Posts
              Bruno - thank you for solution and such a quick response. That works perfectly!!
                Helen Warner
                Number one pixel!
                Proud to be linked with MODX at Crimson Pixel