ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Related Banner Display

March 29, 2012 12:20pm

Subscribe [2]
  • #1 / Mar 29, 2012 12:20pm

    DigitalDesigns

    94 posts

    We are attempting to set up a channel that manages advertising banners for our site, and can be classified in order to control which of the event entry pages they show on.

    The event entries are created utilizing Solspace Calendar, and the advertising code that shows the banners is as follows:

    <div class="widthlimit">
            <div id="ad">
     {exp:channel:entries channel="advertisements" limit="1" orderby="random" dynamic="no"}
            Sponsored By: 
     <a href="http://{url-destination}" title="{title}" target="_blank" rel="noopener">{if banner-ad}{banner-ad}{if:else}{text-ad}{/if}</a>
     {/exp:channel:entries}
     </div><!--AD--> 
    </div>

    This allows the advertisement entry to be either a banner or a text link - HOWEVER we now need to be able to control which of the banners is displayed (right now it rotates from ALL the entries in the channel).  Currently the entry page (where the code above is listed) is a dynamic page that showcases an entry of a selected calendar.  We want to be able to associate a calendar with a specific group of ads.

    Can we use categories (event entry category matches advertisement category)?
    Should we use relationships (playa, etc)?

    Suggestions?

  • #2 / Mar 29, 2012 5:37pm

    John St-Amand

    865 posts

    It would certainly be worth giving it s shot with the related categories mode enabled, allowing you to do as you first suggested - having both the ads and your events share a set of categories and creating a category for each “grouping” that you’re envisioning.  Playa is an outstanding option as well, and gives you a little more control over ordering, sorting and other options, but generally I think you could go native with this one pretty easily.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases