Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Advertising module or similar.

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2438 Views
  • masson
    Avatar
    Community Member
    8 Posts

    Advertising module or similar. Link to this post

    Hey guys,

    Just wondering if anyone has a solution for me. I am trying to display content "images and/or text" here and there on a website built with Silverstripe. However i can´t seem to figure out how i will display the content.
    .
    In the past i have used advertising modules to display this content in other CMS´s i have worked with. Where i create the space, inert the content, either image, link or just plain text then insert a variable in the template which fetches the content. Hopefully this is not too confusing ;).
    .
    Good example: http://www.pureevents.net/
    .
    You can see in the bottom, 4 images including text, how would i display similar content editable in Silverstripe easily?.
    .
    I would really appreciate a help on this, and even better if it´s idiot proof ;). Although i have some knowledge...

  • masson
    Avatar
    Community Member
    8 Posts

    Re: Advertising module or similar. Link to this post

    No one done this before?. Or even something similar.
    .
    Please help me get in the right direction.

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Advertising module or similar. Link to this post

    Depending on what you need to do like the Pure Events site - 4 boxes - you can do it simply by adding 4 HTMLEditor area to your page.

    If you want ads on every page you can Open up page.php and add something this like ..

    Add this to your static $db array

    'BannerAd1' => 'HTMLEditor'

    then add a tab in the CMS to edit it..

    function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab("Root.Content.BannerAd", new HTMLEditorField("BannerAd1", "Banner"));
    return $fields;
    }

    Then if you go to yoursite.com/db/build?flush=1 and make sure it creates the new field and then reload your CMS you should have a new tab in the content area called Banner with a text box that your can add content - images, text, links etc etc.

    All you then need to do is use $BannerAd1 somewhere in the templates to render the add.

    2438 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.