We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42503
    • 120 Posts
    Hi All,
    How I can create banner which will have 8 different button, on clicking on each button the banner will get change, also there will be another button inside the banner section, on clicking that it will take the user to there individual page.

    Thanks in advance.

    Please help.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      These are done with Javascript. There are tons of those available - just do a Google search on "jquery slider" and pick one that you like, presuming that you're OK with using the JQuery library.

      The trick to using it in MODx is to use something like getResources or pdoResources to generate the set of items for the slider. Just use a single line of the HTML structure that the slider you picked uses for the snippet's tpl. Replace the relevant parts (the src for the image, the URL and any captions) with placeholders from the resource's fields.

      For example, if you use this one your tpl would look like this:
      <a href="[[~[[+id]]]]"><img id="slide-img-[[+idx]]" src="[[+tv.image]]" class="slide" alt="[[+pagetitle]]"></a>
        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