We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1512
    • 57 Posts
    Hi everyone,

    i’m in the process of modifying AdsManager to work a little more confortably with a site. At the moment, the snippet is called as such: [[banner_top]] and this will display all ads depending on the tag put in the snippet php itself:

    <?php
    global $modx;
    $basePath = $modx->config['base_path'];
    include_once $basePath.'assets/snippets/adsmanager/adsmanager.inc.php';
    $rotator = new AdsManager('your_tag');
    $rotator->show(1);
    ?>


    what i want to do is move the tags to the snippet call e.g. [[banner_top? &tags=`my_tag`]]. This is what i’ve got so far but doesnt work (i’m not a good php coder as you can probably tell!)

    <?php
    global $modx;
    $basePath = $modx->config['base_path'];
    $tags = (isset($tags))? $tags : 'You forgot the &tags parameter';
    
    include_once $basePath.'assets/snippets/adsmanager/adsmanager.inc.php';
    
    $rotator = new AdsManager('.$tags.');
    $rotator->show(1);
    ?>



    any help would be great

    Thanks
    André