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
    Ok Ok.... I was going to try and work in getting caught up with MadMen and TheKilling, but I can see that's pushed off the schedule?

    In terms of templates, I'm trying to force myself to learn MODx more indepth and create as few templates as possible. My current size is very small so it's been relatively easy to accomplish. In the past, given my limited know how my solution for almost everything was to create a new template. And in terms of styles, rather than thinking globally, I would just create a new style, so by the end of the project I had so many styles going, I couldn't keep them all straight. I'm getting better at it though, and having such a great CMS, and incredible supportive forum has only served to boost my knowledge, and my confidence.

    Talking with my father the other day I mentioned to him that I feel like I've spent most of my life trying to figure out what to do, and now that I'm doing it, I don't know what I'm doing;)

    I jump in and read all the links you've sent my way. Thank you very much for providing this wealth of direction and information.


    Quote from: frogabog at Jul 05, 2013, 06:33 PM
    YW, enjoy!

    Oh, and it's very acceptable to have more than one template for you site. Home/landing pages are most often very different than the inner pages, and while MODX makes it simple to do it with just one template, it can also be simpler to make more than one template. Heck, even 3 or 4 isn't too many for a site that has some distinct variations.

    Keep in mind, that every time MODX passes a conditional element, it has to process it. If only one page is going to use something, it's far more efficient to template it out separately.

    Another approach is to use GetCache and keep MODX from processing things it doesn't have to once the cache is loaded.
    http://devries.jp/blog/2013/03/23/cash-in-big-with-modx-cacheing/

    Another interesting read is http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/


      • 10208 ☆ A M B ☆
      • 1,780 Posts
      Quote from: mmcgee at Jul 05, 2013, 07:02 PM
      Ok Ok.... I was going to try and work in getting caught up with MadMen and TheKilling, but I can see that's pushed off the schedule?

      Catching up with the shows, and MODX only works one way for me...

      Plan to run each episode 3 times. :~}
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 19872
        • 1,078 Posts
        Tried giving the If a whirl but no luck. Think I will need to revisit. I downloaded and installed the snippet, and then modified the menno statement a bit to what I thought it might need to be. It put the first image on the page, and then a few character before and after the photo.

        If the user wants just a single static image, I have that set up as a TV. mainImage. If they want to put a slider on the page, I have that as a chunk. my.slider
        I made the assumption that `slideOption` is the name of the template variable and that the =1 means that there is some form of content that has been entered into the slider which I named imageSlider.

        So I wrote:
        [[!If? &operator=`imageSlider` &operand=`1` &then=`my.slider` &else=`[[*mainImage]]`]]

        As mentioned, this put an image on the page but only after I included the brackets and included the asterisk around mainImage.
        Maybe I need instead of just `my.slider`, I need `[[$my.slider]]

        ?
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          The imageSlider tv needs to be set as a radio option, and in the input for that tv you'll need to enter Yes==1||No==0 to get it to show yes and no radio buttons.
          Make sure to attach the TV to the template you're using.

          Then, in the resource you want the slider on, check that TV as yes.

          You don't need the brackets in the If call for the TV. (&subject)

          Additionally, I assume the markup surrounding the If call is different for the image and the slider, so I'd suggest using chunks for each instead of just the imageTv for the image only. Take your markup for the slider, make a chunk. Same for the image, and call the imageTV in the in that chunk.

          <img src="[[*imageTV]]">


          Edit: I think I made a mistake in the If call, it should have an additional parameter &subject:
          [[!If? &subject=`yesNoTV` &operator=`EQ` &operand=`1` &then=`[[$sliderChunk]]` &else=`[[$imageChunk]]`]]
          [ed. note: frogabog last edited this post 13 years, 2 months ago.]
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 19872
            • 1,078 Posts
            So, I got the site launched last night. Image slider works great. For now I just created a separate template page for the home page where the slider resides. Still need to review everything related to your notes about the If?.

            Meantime, while adding a new promotional slide, it occurred to me that I have no way to control the order in which they load. Yikes. I'll review the modx documentation.

            I have "Set", "Description" & "Image".
            For whatever reason, and just because, I named the Set for each image, "splash". I found the little arrows where I can sort ascending or descending for the Set and Description, but on the Image column that option is grayed out.

            I guess if the Set were simply numbers, like 01, 02, 03, 04.... I could sort the entire group in that method. I don't see a way to go back in and change the info already in the Set column though. [ed. note: mmcgee last edited this post 13 years, 2 months ago.]
              • 19872
              • 1,078 Posts
              I found it. I'm on a MAC, so control click any item and I can modify the entry. Yahoo! I numbered the images the way I want them to appear, and then did a sort. Perfecto!

              Bummer! I spoke to soon. The order within the MIGx Add Item thing changed, but not on the actual web page. More reading is clearly needed. I guess the ordering within the control panel is good. I just assumed the sort was to order was for the web page order.

              I'm reading through a tutorial about attributes, but not sure this is what I need or not.
              http://rtfm.modx.com/display/ADDON/MIGX.Create+selectable+and+sortable+Attributes+List+for+whatever+you+need+it [ed. note: mmcgee last edited this post 13 years, 2 months ago.]
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                With MIGX, just drag and drop the items into the place you wish them to display.
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 19872
                  • 1,078 Posts
                  OK. I did the drag and drop and it worked!

                  Let me ask you this if I may. What is Set? Mark Hamstra's tutorial had used this for one of the columns. Is this for my own reference on the backend so that I can categorize images?

                  Even though I went and changed the set for each image to a sequential number; 01, 02, 03, 04—perhaps this was not necessary.

                  The word "set" to me means "category", "group of", etc.

                  Perhaps this is used for controlling which photos to display. If I have 3 different "sets" then perhaps I can define in my TV which set for the slider to display? [ed. note: mmcgee last edited this post 13 years, 2 months ago.]
                    • 19872
                    • 1,078 Posts
                    Thanks to the tip about the drag and drop. Very helpful. I've confirmed now that my using numbers in "Set" column have no affect on the display order.

                    Clearly, there is a lot for me to learn here to fully utilized the power of this snippet. Next goal today: read more, and see how to attached an href to each image in the slider.

                    I'm thinking it's something along the lines of opening the TV for MIGx, and then adding another form field, and grid column. Then, applying it to my .tpl that contains the <li></li>

                    Fingers crossed. [ed. note: mmcgee last edited this post 13 years, 2 months ago.]
                      • 4172
                      • 5,888 Posts
                      I'm thinking it's something along the lines of opening the TV for MIGx, and then adding another form field, and grid column. Then, applying it to my .tpl that contains the <li></li>

                      exactly that.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!