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
    Hi Susan & Thank You for the response. I've been reading your postings related to MIGx on the DOCs site.

    I must say...I'm holding on to my head to keep it from spinning. smiley

    Two points of clarification if I may:

    1. If I use checkbox, then if no boxes are checked, then nothing appears or gets processed—correct? I inadvertently used List Item and need to change.

    2. You wrote $slider-chunk (with a hyphen), but I assume that this is supposed to be the exact name of my chunk, which in my case is $sliderChunk.

    I was under the impression that once a user selects an option in the managers and populates either a slider or a single image TV that that's what gets generated and sits ready for deployment — whatever the selection is. Is that not the case? By what you're saying about the inner chunks not having tags is that each time a visitor goes to a page, both the slider and the single image get processed and then the determination is made on which to deploy. By what you're saying with your approach, only one or the other but not both get processed thus making the process more efficient.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You don't need a TV to select, or an IF snippet or anything else. Just two chunks, one that holds your HTML and snippets and whatever else you need for the slider, and another one to hold the HTML for the image. The output modifier will automatically output [[$sliderChunk]] if the resource is your site_start page, and [[$imageChunk]] if it is not.
        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
        But what if the user wants nothing—no slider, no image. Point to note here that this is not just for my home or site start page. This is occurring on virtually every page of the site. I want the user to be able to select any given resource and then check whether they want the image area to be populated with a slider or a static image or nothing at all (in which case I need no code to the generated for that area at all). At the moment, Bruno17 method is working the way I want it to, I just need to change my selector from ListItem to Checkbox. As well, my html is inputing a the class for caption regardless of whether there is a caption entered or not. This is problematic in that a sliver of background color appears when displayed, due to various padding rules and background color attributes associated with the caption class.
          • 19872
          • 1,078 Posts
          This is all pretty much over my head, and I and treading water as fast as I can. I do appreciate everyone's support and feedback. Without it, I would truly be adrift with no sight of land.
            • 4172
            • 5,888 Posts
            Quote from: Bruno17 at Feb 16, 2014, 01:18 AM
            If you would show some of your code, it would be easier to help.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 19872
              • 1,078 Posts
              I changed my selector from ListItem to Checkbox and it works perfect. With neither box checked, no code gets generated on the page.

              Now on to controlling the caption or no caption issue and from their how to connect phpThumbsUp.
                • 19872
                • 1,078 Posts
                Quote from: Bruno17 at Feb 16, 2014, 09:11 AM
                Quote from: Bruno17 at Feb 16, 2014, 01:18 AM
                If you would show some of your code, it would be easier to help.

                The tips you provided have worked. Within the manager for a resource I can check either the slider or the image or not check anything and all is working as desired in that regard.

                Below is the code for essentially my list items ".tpl" You can see there is a class for the Orbit caption. That class imparts some padding and background color that even without text reveals itself on the page as a short sliver of color.

                The Goal: If the user doesn't not enter caption text within the MIGx form for a particular image, then the div with the caption class needs to either not be shown or commented out for that particular image.

                <li>
                  <img src="[[+image]]" alt="[[+description:htmlentities]]" />
                  <div class="orbit-caption">[[+description]]</div>
                </li>


                Note: Somehow I have the description setup to go in both the caption area AND the alt tag. I need to review my code for that, because even if the user doesn't want to write a caption for a given photo, and alt tag is still desirable .
                  • 19872
                  • 1,078 Posts
                  Here is my MIGx form tab:

                  [
                  {"caption":"Image", "fields": [
                  {"field":"set","caption":"Set"},
                  {"field":"description","caption":"Description"},
                  {"field":"image","caption":"Image","inputTV":"image"},
                  {"field":"image-link-path","caption":"Image-Link-Path"}
                  ]
                  }
                  ]

                  Below is my code for MIDx Grid Columns

                  [
                  {"header": "Set", "sortable": "true", "dataIndex": "set"},
                  {"header": "Description", "sortable": "true", "dataIndex": "description"},
                  {"header": "Image", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"},
                  {"header": "Image Link Path", "sortable": "false", "dataIndex": "image-link-path"}
                  ]
                    • 19872
                    • 1,078 Posts
                    My other issue is I cannot seem to make the image-link-path work. When I edit the form for an image, I have tried entering an absolute URL as well as a MODx link to a resource [[~10]] and no href gets generated for the image.

                      • 19872
                      • 1,078 Posts
                      This is the contents of my slider chunk

                      <ul class="class="dh_orbit" data-orbit data-options="timer_speed:4000; slide_number:false;"">
                          [[getImageList? &tvname=`deserthills.images` &tpl=`@CODE:[[$deserthills.images.gallery.tpl]]`]]
                      </ul>
                      


                      This is the contents of my list item chunk for the slider (a.k.a deserthills.images.gallery.tpl)
                      Perhaps I need to put a placeholder with the img src to hold an image link if one is entered by the user. However, I don’t want the image to take on the attributes of having a link if no link is actually provided. Not sure how to accomplish this.

                      <li>
                        <img src="[[+image]]" alt="[[+description:htmlentities]]" />
                        <div class="orbit-caption">[[+description]]</div>
                      </li>