We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Now, the top slider is in three parts, slide1, slide2 and slide3. Like this...
    <div style="z-index: 17; transform: translateX(-1280px); opacity: 1; visibility: hidden;" class="w-slide slide1">
            <div class="w-container slide-text-container">
              <h2 style="transition: opacity 1000ms ease 0s, transform 1000ms ease 0s; opacity: 1; transform: translateX(0px) translateY(0px);" class="slide-title w-ix-emptyfix" data-ix="fade-down">WE can fix</h2>
              <h3 style="transition: opacity 1000ms ease 0s, transform 1000ms ease 0s; opacity: 1; transform: translateX(0px) translateY(0px);" class="slide-subtitle w-ix-emptyfix" data-ix="fade-down-2">All your problems</h3><a style="transition: opacity 1000ms ease 0s, transform 1000ms ease 0s; opacity: 1; transform: translateX(0px) translateY(0px);" class="button slider w-ix-emptyfix" href="#about" data-ix="fade-down-3">discover  how</a>
            </div>
            <div class="slide1-overlay"></div>
          </div>


    So we'll need a MIGx TV with three fields, I'll name them "slide_title", "slide_subtitle" and "slide_button".

    Our TV:

    General Information tab -
    Name: top_slider
    Caption: Top Slider

    Input Options tab -
    Input Type: MIGx
    Form Tabs:
    [
    {"caption":"Slider Text", "fields": [
       {"field":"slide_title","caption":"Title"},
       {"field":"slide_subtitle","caption":"Subtitle"},
       {"field":"slide_button","caption":"Button"}
    ]}
    ]

    Grid Columns:
    [
    {"header": "Title", "width": "200", "sortable": "true", "dataIndex": "slide_title"},
    {"header": "Subtitle", "width": "200", "sortable": "false", "dataIndex": "slide_subtitle"},
    {"header": "Button", "width": "200", "sortable": "false", "dataIndex": "slide_button"}
    ]


    Template Access tab -
    whatever your main page's template is named

    Then we need a tpl chunk for the getImageList display, based on the structure of each item. Notice the [[+...]] placeholders, using the name we gave the fields, and the MIGx-supplied [[+idx]] placeholder:
    <div style="z-index: 17; transform: translateX(-1280px); opacity: 1; visibility: hidden;" class="w-slide slide[[+idx]]">
    	<div class="w-container slide-text-container">
    		<h2 style="transition: opacity 1000ms ease 0s, transform 1000ms ease 0s; opacity: 1; transform: translateX(0px) translateY(0px);" class="slide-title _[[+idx]] w-ix-emptyfix" data-ix="fade-down">[[+slide_title]]</h2>
    		<h3 style="transition: opacity 1000ms ease 0s, transform 1000ms ease 0s; opacity: 1; transform: translateX(0px) translateY(0px);" class="slide-subtitle _[[+idx]] w-ix-emptyfix" data-ix="fade-down-2">[[+slide_subtitle]]</h3><a style="transition: opacity 1000ms ease 0s, transform 1000ms ease 0s; opacity: 1; transform: translateX(0px) translateY(0px);" class="button slider _[[+idx]] w-ix-emptyfix" href="#about" data-ix="fade-down-3">[[+slide_button]]</a>
    	</div>
    	<div class="slide[[+idx]]-overlay"></div>
    </div>


    And finally, in the content of the main page, replace it with this:
    <!--  top-->
    
    <div class="w-slider top-slider" id="top" data-animation="cross" data-duration="1500" data-infinite="1" data-delay="6000" data-autoplay="1" data-ix="display-nav">
      <div class="w-slider-mask">
        [[getImageList? &tvname=`top_slider` &tpl=`top_slider`]]
      </div>
      <div class="w-slider-arrow-left">
        <div class="w-icon-slider-left arrow"></div>
      </div>
      <div class="w-slider-arrow-right">
        <div class="w-icon-slider-right arrow"></div>
      </div>
      <div class="w-slider-nav w-round">
        <div class="w-slider-dot" data-wf-ignore=""></div>
        <div class="w-slider-dot w-active" data-wf-ignore=""></div>
        <div class="w-slider-dot" data-wf-ignore=""></div>
      </div>
    </div>


    Still haven't figured out where those background images are coming from...

    Ok, found them and put them in the assets/theme/seentheme/images/ folder.


      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
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      So, there you go... the hard-coded menu, the top section, and the rest of the page's general layout is done.
        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
        • 47432
        • 48 Posts
        Hi,
        Thank you so much to taking all this time to help me, it's really amazing! if i can be useful to you for anything, please ask me smiley
        Well i'm working since i wake up on your "course"
        i have done everything, and i'm very happy to have succed and understand migx with the slider
        i had the top section with slider in home resource, and the content is displayed, no problem

        but when it comes to taking each section and putting it in its own resources, i tried with the about section and add your code:

        [[getResources? &parents=`10` &includeContent=`1` &tpl=`@CODE [[+content]]`]]


        but it don't work, as you can see the about section don't appear
        i don't know exactly what i have to put in parents, i tried different things: -1 , as there is no parent
        i also tried to create a folder and put all the resources inside, and give the id of the folder to parent
        but, as you see, no success!
        anyway i have to study more about getresources

        for the slider, the images are bg images in the css (same thing for the quotes sections, and for the works section) and i would like to give the ability to my users to change it easily, that's where you talked to me about clientConfig
        btw, i can see i can use migx also for the quotes section smiley

        For the menus, there is 2 menus, one who appears immediately, and the other one that appear on scroll
        they have no ul li, just links a , so i have arranged the visible one adding the links in ul and li (and of course adapting the css) and i'm gonna do it for the second one
        to prepar them for wayfinder smiley
        is it a good way, or can i let them how they are, and manage everything with wayfinder

        Oh and also tell me why my html is so ugly, i'm really a better designer than coder :-(

        Thanks again, time to lunch smiley
          • 4172
          • 5,888 Posts
          [[getResources? &parents=`10` &includeContent=`1` &tpl=`@CODE [[+content]]`]]


          @CODE does not work with getResources, only with getImageList - snippet of MIGX

          try @INLINE for inline tpl-code in getResources:

          [[getResources? &parents=`10` &includeContent=`1` &tpl=`@INLINE [[+content]]`]]


          &parents is the id of the parent (or multiple parents) where you have your section-pages.

          so, if you have your section-pages as sub - Resources of the Home - Resource (I think this is your onePage)
          then you can do:

          [[getResources? &parents=`[[*id]]` &includeContent=`1` &tpl=`@INLINE [[+content]]`]]


          otherwise, if you have them in another container(parent) then use the id of that one.


            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 4172
            • 5,888 Posts
            For the menus, there is 2 menus, one who appears immediately, and the other one that appear on scroll
            they have no ul li, just links a , so i have arranged the visible one adding the links in ul and li (and of course adapting the css) and i'm gonna do it for the second one
            to prepar them for wayfinder smiley
            is it a good way, or can i let them how they are, and manage everything with wayfinder

            if you prefer to have your own markup in the menues and not as unordered lists, you can change all wayfinder-tpls
            or its of course also possible to use getResources for them
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 4172
              • 5,888 Posts
              for the slider, the images are bg images in the css (same thing for the quotes sections, and for the works section) and i would like to give the ability to my users to change it easily, that's where you talked to me about clientConfig

              you could just add another field to your MIGX-TV for selecting the image

              Form Tabs:

              [
              {"caption":"Slider Text", "fields": [
                 {"field":"slide_title","caption":"Title"},
                 {"field":"slide_subtitle","caption":"Subtitle"},
                 {"field":"slide_button","caption":"Button"},
                 {"field":"image","caption":"Image","inputTVtype":"image"},
              ]}
              ]


              Grid Columns:

              [
              {"header": "Title", "width": "200", "sortable": "true", "dataIndex": "slide_title"},
              {"header": "Subtitle", "width": "200", "sortable": "false", "dataIndex": "slide_subtitle"},
              {"header": "Button", "width": "200", "sortable": "false", "dataIndex": "slide_button"},
              {"header": "Image", "width": "200", "sortable": "false", "dataIndex": "image","renderer":"this.renderImage"}
              ]


              and you could add another getImageList - call to your CSS to generate the bg-images
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 47432
                • 48 Posts
                Thank you Bruno!
                i'm trying it, but as i am an absolute beginner i don't know how to add a getimageList call to my css :-(
                and also i would like to know the meaning of the width: 200 as obviously my images are bigger than 200, but also my title and subtitle
                and also the meaning of renderer":"this.renderImage"

                For the menu, as i have 2 menus, im gonna try the 2 ways, so i will see which is better
                i work with webflow, and it generate nav like that for the moment
                  • 4172
                  • 5,888 Posts
                  i don't know how to add a getimageList call to my css
                  what does your current CSS (the part where you are defining the bg-images) look like?


                  i would like to know the meaning of the width: 200 as obviously my images are bigger than 200, but also my title and subtitle
                  and also the meaning of renderer":"this.renderImage"

                  {"header": "Image", "width": "200", "sortable": "false", "dataIndex": "image","renderer":"this.renderImage"}


                  width is just the width of the column in the manager-grid of the MIGX-TV (its relative to the width of the other columns)
                  the renderer this.renderImage does render the selected image into the column of the grid
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 47432
                    • 48 Posts
                    here is my css:

                    .slide1 {
                      background-image: url('../images/slider/77H.jpg');
                      background-position: 0% 1%;
                      background-size: cover;
                      background-repeat: no-repeat;
                      opacity: 1;
                    }
                    .slide2 {
                      background-image: url('../images/slider/unsplash_527e864de3770_1-(1).jpg');
                      background-position: 0% 62%;
                      background-size: cover;
                      background-repeat: no-repeat;
                    }
                    .slide3 {
                      background-image: url('../images/slider/lighthouse.jpg');
                      background-position: 0% 63%;
                      background-size: cover;
                      background-repeat: no-repeat;
                    }
                      • 4172
                      • 5,888 Posts
                      you will need to have this part of the CSS inline in your template, not included with a CSS-file

                      than you can generate that part with

                      <style type="text/css">
                      [[getImageList? &tvname=`top_slider` &tpl=`top_slider_css`]]
                      </style>
                      


                      the chunk top_slider_css:

                      .slide[[+idx]] {
                        background-image: url('../[[+image]]');
                        background-size: cover;
                        background-repeat: no-repeat;
                        opacity: 1;
                      }


                      not sure, if that line is needed at all and what the different values needs to be
                       background-position: 0% 1%;

                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!