We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31902
    • 342 Posts
    I've been playing with the BannerY component and the ad banners have been showing up on the page, but instead of one banner at a time and rotating (as I suspect they should), they get displayed all at once. I'm testing this with 3 banners, all on position 1.

    Should this component be displaying them one at at time? Should they be rotating? The instructions aren't clear on this.

    In the template, I am calling the banners with this:

    [[BannerY? &position=`1` &sortby=`RAND()` &limit=`3`]]


    I noticed that the stock chunk (called byAd) this component supplies looks like this:

    <p><a href="bannerclick/[[+adposition]]"><img src="[[+image]]" alt="[[+name]]" title="[[+description]]"/></a></p>
    <p>Banner with extra params (available as placeholders in banner URL):<br />
    <a href="bannerclick/[[+adposition]]?id=[[*id]]&something=123"><img src="[[+image]]" alt="[[+name]]" /></a></p>


    ...which results in two of each ad banner showing up on the page and the words "Banner with extra params (available as placeholders in banner URL):" in there. I edited the chunk to remove the wording, as well as the...

    <a href="bannerclick/[[+adposition]]?id=[[*id]]&something=123"><img src="[[+image]]" alt="[[+name]]" /></a></p>


    ...part, which results in only one banner of each. Okay, but the thing is still showing all banners, side-by-side, at once.

    What am I missing here? Seems like there are steps I should be performing but the instructions don't offer them.

    Thank you in advance.

    Revo: 2.2.2-pl
    bannerY 1.0.1 [ed. note: waizen last edited this post 13 years, 8 months ago.]
      • 28000 ☆ A M B ☆
      • 397 Posts
      Why aren't you setting the limit to 1 if you only want to show one ad? I think it works like getResources. The limit sets how many banners it will show at one time.
        Benjamin Davis: American web designer living in Munich, Germany and a MODX Ambassador. I am also co-founder of SEDA.digital, a MODX Agency.
        • 31902
        • 342 Posts
        Quote from: sonicpunk at Feb 08, 2013, 01:37 PM
        Why aren't you setting the limit to 1 if you only want to show one ad? I think it works like getResources. The limit sets how many banners it will show at one time.

        No, I have 3 banners I want to show...but one at a time in that space on page view/refresh. I was under the impression that multiple banners can be displayed in that same space. One at a time, but different ads each time you visit/refresh the page. At least that's how other systems work.

        Am I wrong? If not, then what's the point of this component, since I could just throw some adds up there like linked images. I would think it rotates.
          • 28000 ☆ A M B ☆
          • 397 Posts
          But you only want to show 1 banner at a time correct? Per view / refresh? It would already achieve that - it just selects the banner randomly (if you set your limit to 1). You would like it to sequentially show your ads as the user goes through the site? So that the component would track the user to guarantee that the user sees all 3 ads instead of just a random selection? Am I understanding correctly?
            Benjamin Davis: American web designer living in Munich, Germany and a MODX Ambassador. I am also co-founder of SEDA.digital, a MODX Agency.
            • 31902
            • 342 Posts
            Quote from: sonicpunk at Feb 08, 2013, 02:04 PM
            But you only want to show 1 banner at a time correct? Per view / refresh? It would already achieve that - it just selects the banner randomly (if you set your limit to 1). You would like it to sequentially show your ads as the user goes through the site? So that the component would track the user to guarantee that the user sees all 3 ads instead of just a random selection? Am I understanding correctly?

            Yes.

            I just tried changing the call to:

            [[BannerY? &position=`1` &sortby=`RAND()` &limit=`1`]]


            ...and it showed only one banner but it only displayed that one same banner, no matter how many times I refreshed the page.
              • 31902
              • 342 Posts
              Okay, now it's changing, but only if I go to different pages (the call is on the template, which displays the ad in all the pages that are set to that template). However, it doesn't change if I just refresh the page. Could it be a cache thing?
                • 31902
                • 342 Posts
                Ahhh, yep... I think that was it. I added the exclamation point to the call, so it now reads like this:

                [[!BannerY? &position=`1` &sortby=`RAND()` &limit=`1`]]


                ...and now it works, even on refresh.

                Thanks, sonicpunk!
                  • 28000 ☆ A M B ☆
                  • 397 Posts
                  Yeah the caching would create a problem there. Good detective work!
                    Benjamin Davis: American web designer living in Munich, Germany and a MODX Ambassador. I am also co-founder of SEDA.digital, a MODX Agency.