We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12584
    • 208 Posts
    I am trying to get a TV to output an image,in the properties fields I selected the images and on the document page under the template variable tab I can see the image no problem, however in the chunk which is being called from a template in get resources I have added this call [[*showroomimg]] which as far as I can see this is the call for TV’s in Revo however no image is output.

    Can anyone tell me if this look right.

    Many thanks
      • 33997
      • 150 Posts
      Check out your page source - are you sure the TV isn’t outputting? Did you wrap the TV in an img tag, i.e.:
      <img src="[[*showroomimg]]" alt="Show Room" />
      

      The image TV only outputs the path to the resource.
        "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
        • 3749
        • 24,544 Posts
        MODx creates a full image tag for image TVs, but only if you have the TV’s output type set to image rather than default. The down side is that all images using that TV will get the same size, caption, alt value, etc. I’d recommend leaving the output set to default and build the tag yourself as goonz suggests, using separate TVs for the other attributes.
          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
          • 12584
          • 208 Posts
          OK understand leaving the output at default and I have now changed it back that and wrap it inside what i need. I still have the issue of nothing being output by the TV right now, I have left the input type as image and on the child page where I have added the image using the TV i can see the image there ok but I cant see it when its called via getresources via the chuck in the template.

          Thanks for the advice however its so useful.

          Many thanks

          Ian

          quick edit here this is whats in my chunk:
          <h2>[[+pagetitle]]</h2>
          [[*showroomimg]]
          <img src="[[*showroomimg]]" alt="Show Room" />
          <p>
          [[+introtext]] - <a class="readmore" href="[[~[[+id]]]]" title="[[+pagetitle]]">More Information ..</a>
          </p>
          <hr />


          Its all very experimental for now but I just cant get that damn TV to work
            • 12584
            • 208 Posts
            I have now tried every method on the TV to do with input type and output type, the only thing that nakes a differance is if I change the output to rich text then I do indeed get a text box appear.

            If I add in just the TV it’s not outout at all but if included inside the image tag the resulting html is this
            <h2>test 2</h2>
            no output no img output 2nd
            <img src="[*showroom]]" alt="Show Room">now outside of img tag


            If anyone know a way to find why the template vairable call wont work or another day to acheive this please let ne know I am guessing that is the correct call for a TV in Revo.

            Thanks again

            Ian

              • 3749
              • 24,544 Posts
              If the tag is in a Tpl chunk used by getResources, you need to use a placeholder tag:

              [[+TvName]]


              You’ll also need to add the TV-related parameters to the getResources tag: &tvPrefix, &includeTVs, etc.
                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
                • 12584
                • 208 Posts
                Quote from: BobRay at Mar 02, 2011, 12:02 PM

                If the tag is in a Tpl chunk used by getResources, you need to use a placeholder tag:

                [[+TvName]]


                You’ll also need to add the TV-related parameters to the getResources tag: &tvPrefix, &includeTVs, etc.

                Bob you might have just seen the missing details I have experimented with them placeholders in the call but still no luck, I cant find any documentation or working examples of getResources so I am just running with the similar method to ditto, so here’s everything I have.

                The parent page has this call
                [[getResources? &parents=`49` &tpl=`showroom`]]


                The showroom chunk tpl now has this
                <h2>[[+pagetitle]]</h2
                [[*showroom]]
                
                <p>
                [[+introtext]] - <a class="readmore" href="[[~[[+id]]]]" title="[[+pagetitle]]">More Information ..</a>
                </p>
                <hr />


                The template variable is called showroom has in input of image and an output of default.

                The html output is the following
                <h2>test 2</h2>
                bike2.jpeg
                
                <p>
                 - <a class="readmore" href="index.php?id=54" title="test 2">More Information ..</a>
                </p>
                <hr>
                <h2>test 1</h2>
                
                bike2.jpeg
                
                <p>
                 - <a class="readmore" href="index.php?id=53" title="test 1">More Information ..</a>
                </p>
                <hr>
                


                On that html the TV outputs bike2.jpeg on both pages but one of them should be bike1.jpg it looks like I am missing some other bits to make this work.

                Any more help would be great thanks for everything so far.
                  • 3749
                  • 24,544 Posts
                  Make it [[+showroom]] and add these to your getResources snippet tag:

                  &tvPrefix=`` &includeTVs=`1`
                    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
                    • 12584
                    • 208 Posts
                    Quote from: BobRay at Mar 02, 2011, 04:15 PM

                    Make it [[+showroom]] and add these to your getResources snippet tag:

                    &tvPrefix=`` &includeTVs=`1`

                    Damn still no luck.
                    I made the tag this
                    [[getResources? &parents=`49` &tpl=`showroom` &tvPrefix=``  &includeTVs=`1`]]

                    and in the chunk tpl i changed from [[*showroom]] to [[+showroom]]which resulted in no output. If I left the tag as [[+showroom]] outputs bike2.jpeg as in previous post.

                    For info I got the TV tag syntax from here http://rtfm.modx.com//display/revolution20/Tag+Syntax


                    Is there anything else left to try I wonder.

                    Thanks again for you patience.

                    Cheers

                    Ian
                      • 12584
                      • 208 Posts
                      Still no luck but i just see this post http://modxcms.com/forums/index.php?topic=55069.0
                      http://modxcms.com/forums/index.php?action=post;topic=61741.0;num_replies=8
                      SO now I have tried on parent page this call:
                      [[getResources? &parents=`49` &tpl=`showroom` &tvPrefix=``  &includeTVs=`1` &processTVs=`1`]]


                      And my tpl chunk now looks like this:
                      <h2>[[+pagetitle]]</h2>
                      [[+tv.showroom]]
                      
                      <p>
                      [[+introtext]] - <a class="readmore" href="[[~[[+id]]]]" title="[[+pagetitle]]">More Information ..</a>
                      </p>
                      <hr />


                      Result is still no output for tonight I give up huh