We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    Currently with my template variables that I set up for images, I am also creating additional template variables for the alt tag and the title tag as well as an id if needed. Is there a way to handle the tags as part of the Image TV itself?
      • 19872
      • 1,078 Posts
      I'm hoping someone provide some feedback on this subject. Also, as I am working here with Image TVs, I notice that once I have an image in a TV, there appears to be no way to delete it. That's odd. Do I need to create a radio selector for something like that? It just occurred to me that at times, the user main want to Not have an image on the page.
      Show Main Image==[[*mainImage]]||Show None==

      Again, maybe this pertains to settings that I can include within the actual Image TV along with alt and title tag fields.

      I'm using radio selectors on another section, but that is providing options between a MIGX slider, or a Single Image, or a Show None.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        To remove an image, just empty the field.

        You can use MODX tags in the fields for the image output widget when creating the TV. Otherwise, if you want multiple fields for a TV, use MIGx.
          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
          • 19872
          • 1,078 Posts
          I do have MIGx set up to control options for either a slider or a single image, but in some instances I just have a single image and want to keep it pretty simple. I'll go back in an review in the morning. It just seemed like a lot of extra work to create an Image TV, and then an alt TV and a title TV, etc. to go along with the image.

          Thanks for the tips. Much appreciated.
            • 19872
            • 1,078 Posts
            Hi Susan:

            When you say MODx tags... are you referring to things like [[~link]] and [[+placeholder]]?
            It's not clear to me how the user on the backend is going to type in content for the placeholder or link, etc. I will have to experiment with this a bit more.

            I do have a MIGx that I am using and have also created a selector so that the user can select either the Slider with gets populated by MIGx entries, or select just a single image, which gets inserted from an image TV. For that image TV, I also have another TV for the alt tag, and have a placeholder in my page code alt="[[*myImageAlt]]"
            Just wonder if the alt portion can actually be part of the image TV so that I don't have to create separate TVs for the alt, title, link, etc..


            Quote from: sottwell at Mar 22, 2014, 08:31 PM
            To remove an image, just empty the field.

            You can use MODX tags in the fields for the image output widget when creating the TV. Otherwise, if you want multiple fields for a TV, use MIGx.
            [ed. note: mmcgee last edited this post 12 years, 6 months ago.]
              • 4172
              • 5,888 Posts
              you may try the image+ - TV - type.
              I think it as an extra field for an alt-tag.

              Should also be possible to extend it with some custom-coding with more fields.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 19872
                • 1,078 Posts
                Thanks Bruno. Working on it now.

                Quote from: Bruno17 at Mar 23, 2014, 10:24 AM
                you may try the image+ - TV - type.
                I think it as an extra field for an alt-tag.

                Should also be possible to extend it with some custom-coding with more fields.
                  • 19872
                  • 1,078 Posts
                  In reviewing, this is the process I am using. I create the TV. Set Input to "image" Then set Output to image. There is a field for alt text, but this is only within the TV, which the end user will not necessarily have access to.

                  In this alt field I can insert some text like "Really Cool Image" but then this text will appear on every image that gets inserted onto a resource through this TV "Not Really Cool"

                  The other method, which I currently am using is to insert the name of another TV that has been set up for an alt tag, and then in the Image TV alt field enter the call for that alt text TV like [[*myAltText]]

                  So I guess the answer is: An TV set to image TV will only provide to the user in the manager the option of only inserting an image. Any other tags that need to be associated with the image would need to be accomplish through the use of additional TVs, or through the use of MIGx.

                  With MIGx the benefit as I see it is that all things related to the Image are in one contained location, making it easy for the user/manager to see that needs to be or can be entered, rather that a bunch of different TVs floating loose in the resource manager.
                    • 19872
                    • 1,078 Posts
                    Or more succinctly, MIGX extends a normal MODX Template Variable to be a container of other Template Variables or just general input variables in the form of a JSON string.
                      • 4172
                      • 5,888 Posts
                      I was talking about this one http://alanpich.github.io/tvImagePlus/

                      It does store the info of one image (and additional fields) as a json-string, too
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!