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

    I’m new to Modx and this is the first website I’m building using Revolution.

    I’m trying to create an image TV. Following the tutorial http://rtfm.modx.com/display/revolution20/Template+Variables I have given it the variable Name of bioPhoto and input type is image. On my template I have called to the TV [[*bioPhoto]]. Which is all fine. However when I select the image from my resources page and then save and preview it, all I see is the link address to the image: /assets/images/dummy1.jpg.

    Also I would like to use a PHx/CustomModifiers code on the image. The below code works for Evolution, but what would be the equivalent for Revolution, as there is no Phx snippet to download.
    <!--insert if image if image present show this li-->
    [+phx:if=`[*image1*]`:is=``:then=``:else=`[*image1*]`+]

    Many thanks in advance
      • 22019
      • 390 Posts
      1. Set the output type of the bioPhoto TV to image

      2. Use output filters http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters, or if you’re lazy like me, just put that placeholder [[*bioPhoto]] in your template / chunk - if there isn’t an image, it won’t be output.
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 4882
        • 44 Posts
        Thanks,

        1. but when I change the output to image. All i get on the page is an x where the image should appear.

        2. Cheers for that, im reading the filters now.
          • 33337
          • 3,975 Posts
          Try [[*bioPhoto:default=``]]

          It will output nothing if TV is empty.
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 22019
            • 390 Posts
            Assuming you haven’t changed filemanager_url setting (which I may be getting wrong anyway) then the only time I can remember the image not showing was when I had modx running in a hosted sub-directory - fixed by using a base href tag in the head
            <base href="**"></base>



              Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
              • 4882
              • 44 Posts
              Thanks zi and odeclas . It’s working fine now