We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24981
    • 109 Posts
    We have developed a Abvert Server modules/snippet that lets you set which pages and advert is displayed on.

    You can see it in use at http://www.thesand.com.au/ - see Sponsored Links on the left.

    It works like this:

    1. Create adverts as pages. The actual advert html served is set using templates (eg, image+link, text+link). It uses Ditto code so you should be familiar with this. The adverts are just pages in a folder.




    2. Add a Snippet to each page where you may want adverts to be displayed (usually in the template - so they can display on every page). Set how many adverts are to be displayed on that page; the adverts will be served randomly from the pool available for that page.
    [!AdvertServer? &tpl=`advertsAdvertsTpl` &startID=`75` &summarize=`2` &sortBy=`pub_date` &sortDir=`DESC` &randomize=`1` !]


    ...again this is basically a modded version of Ditto, so all the concepts for displaying the blocks are the same.

    3. Go to Advert Server module. The module get a list of all adverts in the folder. You can then use the same syntax as teh Document Manager - to set which pages the adverts are displayed on eg. 2* = page 2 and immediete children, 2** = page 2 and all children.



    We are happy to contribute code to the community under GPL. We are not actively developing, so if anyone is interested in cleaning this up, and growing it please contact me. Code is contributed as is!

    Regards

    Richard


    • Very cool Richard. Can you describe a bit more in detail what the Module does? Thanks!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 24981
        • 109 Posts
        The problem we set out to solve was that if we used Ditto to server Adverts we either had to server randomly from a single set of pages, or use TAGS etc to categorize the adverts. The problem is that this would require minor changes to th Ditto settings on every page. In the Module, you control centrally which objects Ditto serves; so the Ditto settings are the same on every page.

        In essence, it lets you:
        1. Create a list of html "objects" eg. adverts that need to be served on different parts of the site.
        2. Set which pages the advertisements should be displayed on.
        3. When a page is displayed the adverts are served randomly from the pool of adverts available from that page.

        It also easily lets you show adverts in entire sections of your site by using the Document Manager syntax eg. 3* will show that advert on page 3 and all immediate children. So if you had a Finance Portal, and you have a whole section with topics on Mortgages; you can easily set the mortgage related advert just to show in the Mortgate section.

        For example
        AdvertA module settings = 1, 2, 3*
        AdvertB module settings = 2, 4
        AdvertC module settings = *
        and
        Ditto setting in template is set to show 1 advert randomly

        THEN results are:
        Page 1 - will server 1 advert from pool: AdvertA, or AdvertC (C is * so all pages)
        Page 2 - will server 1 advert from pool: AdvertA, AdvertB, Advert C
        Page 7 (which is under page 3 in hierarchy) will serve 1 advert from pool: AdvertA (because 3* is all children fo 3), Advert C (C is * so all pages)

        Instead of building a Reporting function - we just added Google Analytics tags to each advert, to count clicks.

        Hope this makes sense. We are about to roll out changes to a magazine site which will use the same module. I will post link here shortly.

        Richard
        • Thanks Richard. Very cool idea indeed. I wonder if you could use the plain ditto and drive certain options from the query string?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 24981
            • 109 Posts
            That would take some fancy typing smiley
            • Or a plugin that looks at what the module sets up ... smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 24981
                • 109 Posts
                Each advert draws on the same template (chunk) to display.

                So in our case, we have duplicated the Advert Server; we have one for text adverts, and one for banners. The adverts are drawn from different folders.

                However, if you used a generic template and put the different html in the TV for different display you could display different kinds of adverts.

                Richard