Question

Photo of Don Smallman

0

Functionality of main ADs

Is there anyway to create a main Ad that does NOT go to another page when clicked on? Or, to have it go to a page that is already on the website?  Or, should this be a suggested feature?

Thanks!

  • Photo of Trey Hendon III

    2

    I've been able to change the functionality of the Ads and their click-ability.  So far, I added two new attributes to the External Website Ads: "Direct URL" and "Not Clickable"

    Whenever a value is in the Direct URL, the Liquid knows to send the user to that URL, not the Ad Details page.

    Whenever the "Not Clickable" is clicked, the Homepage Rotator does not allow that Ad to be clicked.

    Here's how to do it:

    Let's start with the Content Channel Attributes.  Open: Admin Tools > Communication Settings > Content Channel Types > Website Ads
    In the Item Attributes section, add two new attributes with the following parameters:

    • Direct URL
      • Name: Direct URL
      • Description: The Direct URL to use for an Item rather than the Item ID on Linked Page.
      • Field Type: Text
    • Not Clickable
      • Name: Not Clickable
      • Description: Causes the image to not be clickable in the Homepage Rotator.
      • Field Type: Boolean
      • True Text: Yes
      • False Text: No
      • Default Value: unchecked

    Save the changes to the Content Channel Type.

    Next, let's update the Lava files.  Since the Lava files are related to your site's Theme, the location of the files needing to be updated vary.  Here are the two files that need to be updated:
    Themes/**your_theme_name**/Assets/Lava/AdRotator.lava
    Themes/**your_theme_name**/Assets/Lava/AdAdList.lava

    New code for AdRotator.lava:

    <div id="announcement-rotator" class="carousel slide" data-ride="carousel">
      <!-- Wrapper for slides -->
      <div class="carousel-inner">
        {% for item in Items %}
        {% if forloop.index == 1 -%}
          <div class="item active">
          {% else -%}
          <div class="item">
            {% endif -%}
            {% assign notClickable = item | Attribute:'NotClickable' %}
            {% if notClickable == 'Yes' %}
              {{ item.Image }}
            {% else %}
              {% assign directUrl = item | Attribute:'DirectURL' %}
              {% if directUrl != empty -%}
                <a class="announcement-link" href="{{ item | Attribute:'DirectURL' }}">{{ item.Image }}</a>
              {% else %}
                <a class="announcement-link" href="{{ LinkedPages.DetailPage }}?Item={{ item.Id }}">{{ item.Image }}</a>
              {% endif %}
            {% endif %}
          </div>
          {% endfor %}
      </div>

      <!-- Controls -->
      <a class="left carousel-control" href="#announcement-rotator" data-slide="prev">
        <span class="fa fa-chevron-left"></span>
      </a>
      <a class="right carousel-control" href="#announcement-rotator" data-slide="next">
        <span class="fa fa-chevron-right"></span>
      </a>

    </div>

    New code for AdList.lava:

    <div class="row announcement-list">
      {% for item in Items %}
      <div class="col-md-4 col-sm-6 announcement">
        {% assign directUrl = item | Attribute:'DirectURL' %}
        {% if directUrl != empty -%}
          <a class="announcement-link" href="{{ item | Attribute:'DirectURL' }}">{{ item.Image }}<span class="announcement-link-title">{{ item.Title }}</span></a>
        {% else %}
          <a class="announcement-link" href="{{ LinkedPages.DetailPage }}?Item={{ item.Id }}">{{ item.Image }}<span class="announcement-link-title">{{ item.Title }}</span></a>
        {% endif %}
        <h5 class="announcement-text">{{ item.SummaryText }}</h5>
        <p>
          {% if directUrl != empty -%}
            <a class="view-details btn btn-default" href="{{ item | Attribute:'DirectURL' }}" role="button">View details »</a>
          {% else %}
            <a class="view-details btn btn-default" href="{{ LinkedPages.DetailPage }}?Item={{ item.Id }}" role="button">View details »</a>
          {% endif %}
        </p>
      </div>
      {% capture breakNow %}{{ forloop.index | Modulo:3 }}{% endcapture %}
      {% if breakNow == 0 -%}
    </div>
    <div class="row announcement-list">
      {% endif -%}
      {% endfor -%}
    </div>

    You can see examples of this in action here.  Hope this helps!

    Trey

    • Don Smallman

      Thanks! I like your website. Are you going to create templates as part of your business model as well?

    • Trey Hendon III

      Thanks Don! Yes, templates are something that PCR does. As with everyone, I'm getting up to speed on the particulars for Rock, but I've built several templates for another management system over the years.

    • Don Smallman

      Good to hear. Sorry to get off of the original topic, but if changed the background color of my template and recompiled it, can I just copy the Theme folder back to the website, or are there other folders involved?

    • Trey Hendon III

      That should be all it takes, just to verify, you're not making the changes to Stark are you? The current PCR Theme is a copy of Stark with some CSS mods.

  • Photo of Trey Hendon III

    1

    Regarding positioning, I use the "Order Items By" setting and use "Priority - Ascending".  Then, I use the Priority field on the Ads to order (0 is most important).

    To not show any of the text, try this [untested and updated] Lava:

    <div class="row announcement-list">
      {% for item in Items %}
      <div class="col-md-4 col-sm-6 announcement">
        {% assign directUrl = item | Attribute:'DirectURL' %}
        {% if directUrl != empty -%}
          <a class="announcement-link" href="{{ item | Attribute:'DirectURL' }}">{{ item.Image }}</a>
        {% else %}
          <a class="announcement-link" href="{{ LinkedPages.DetailPage }}?Item={{ item.Id }}">{{ item.Image }}</a>
        {% endif %}
      </div>
      {% capture breakNow %}{{ forloop.index | Modulo:3 }}{% endcapture %}
      {% if breakNow == 0 -%}
    </div>
    <div class="row announcement-list">
      {% endif -%}
      {% endfor -%}
    </div>

  • Photo of Jeremy Turgeon

    0

    Hi Don,

    In the HTML for your dynamic content channel it usually has a line like:

    <a href="{{ LinkedPages.DetailPage }}?Item={{ item.Id }}">{{ item.Image }}</a>

    This displays the image and makes it clickable.  Simply remove it and a only include {{ item.Image }}.  Certain DCCs use a liquid form for all their settings like: 

    {% include 'AdRotator' %} .  You should probably create a new copy of the one you're trying to replicate and then edit it with the desired changes.

     

    Hope that helps!

    • Don Smallman

      Thanks! I'll give that a try. Do you think the future will bring changes that will make this as easy as adding a url if I want it to go somewhere else, or to turn off the detail AD by checking a box?

  • Photo of Don Smallman

    0

    Yeah, I looked at that.  I guess that is not what I would like to accomplish.  I think it would be nice if we could link those images to an existing page on the site.

    Thanks!

    Don

  • Photo of Don Smallman

    0

    Hi guys.  Still looking for an answer to this.  Jeremy's solution (I Belive) will disabble the detail on ALL ADs.  I just want to once in a while ad an AD that will allow me to link to another page on the site.  Like when LTG's (Small groups) are starting up, to create an AD that will link to the LTG page that is already built.

  • Photo of Don Smallman

    0

    Is it possible to have the main Ad and the Sub-Ads to other pages on the website, other than the Ad/Sub-Ad details page?

  • Photo of Don Smallman

    0

    Trey, what if I want ONLY images with no text beneath the Ads?  Also, is there a way to reorganize the position of the Sub-Ads without having to delete and re-add them?  Sorry for so many questions.