GithubHelp home page GithubHelp logo

helpfulrobot / nyeholt-silverstripe-interactives Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nyeholt/silverstripe-interactives

0.0 2.0 0.0 51 KB

Trackable interactive elements that can be used for call-to-actions, advertisements or AB style testing

License: BSD 3-Clause "New" or "Revised" License

PHP 65.85% JavaScript 34.15%

nyeholt-silverstripe-interactives's Introduction

SilverStripe Advertisement Management module

A simple module to manage advertisements on pages.

Maintainer Contact

Marcus Nyeholt

<marcus (at) silverstripe (dot) com (dot) au>

Requirements

SilverStripe 3.1.x

Documentation

Add

Page:
  extensions:
    - AdvertisementExtension
SiteConfig:
  extensions:
    - AdvertisementExtension

to your project's configuration yml file.

Note that ads are inherited hierarchically, so setting ads on the Site Config will mean those ads are used across all pages unless specified for a content tree otherwise.

  • Navigate to the "Ads" section

  • Create some Advertisements

  • If you want to group the ads in a collection, create an Ad Campaign. These in turn can be associated with a client.

  • On the Advertisements tab of a page (or Site Config), you can select the individual ads (or campaign) to be displayed.

  • In your page template, use the AdList collection to actually list out the Ads to be displayed. Use the "Me" or "SetRatioSize" helpers to output an image linked as needed for proper click tracking.

    <% loop SiteConfig.AdList %>

    $Me $SetRatioSize(120,80)
    <% end_loop %>
  • You can have complete control over how things are output by referring to the ad's Image and Link accessors. Be aware that if you're going to manually output the link, to include a special attribute used if tracking ad views (eg Advertisement::$use_js_tracking = true). So, output something like

<a href="$Link" class="adlink" adid="$ID"><img src="$Image.Link" /></a>
  • Reference an ad directly from a template via
$findAd(Title)

Check the Advertisement class for more.

TODO

Add extension method and include for doing a rotating ad banner across all pages. You can do these manually for now via Page_Controller if you want. Just select all Ads and iterate the collection

nyeholt-silverstripe-interactives's People

Contributors

nyeholt avatar spekulatius avatar simonexmachina avatar

Watchers

James Cloos avatar helpfulrobot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.