We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40643
    • 36 Posts
    I have created the Article row template and using the IF addon as such:

    [[!If?
    &subject=`[[+author]]`
    &operator=`isempty`
    &then=`[[+createdby:userinfo=`fullname`]]`
    &else=`[[+author]] - Age: [[+age]]`
    ]]

    I would like to display the user info if the TV for author is empty. When I use the IF Addon on the article template it works perfectly but not on the article row template. I have tried it cached and uncached. I have cleared the site cache as well but it only shows the user that created the article.

    Can someone help with this?

    I am using the latest version of modx, php 5.3

    Thanks

    Lisa
      • 3749
      • 24,544 Posts
      I can't think of a good way to do that without some custom code. When Articles is cycling through the articles, it will will embed the If snippet in each one, but it if it's uncached, it won't be parsed until later, when each author's data is not available any more. If it's cached, I think you'll get the user of the first article for all of them and the output modifier might not execute.





        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 40643
        • 36 Posts
        That is exactly what is happening. I am only getting the user of the first article on the category page. I will have to put together a different solution.

        Thanks Bob. BTW I love your book, it's a great resource for me.

        Lisa

          • 3749
          • 24,544 Posts
          Thanks for the kind words and for buying my book. The digital version is coming soon. wink
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting