A sub content system for managing adverts within Neto


[%advert type:'text' ad_group:'' template:'' limit:'1'/%]


The advert tag will load different adverts configured in Neto based on the type parameter and the template. The two types neto supports are text & product, discussed in more detail below.

Please note : We did have a third, banner type which has since been deprecated as the functionality can be replicated with the text type. While we don't support this function in the control panel, the banner type will still work and uses the same asset_url, url & headline tags.

Text adverts

Text adverts are a versatile type that has space for an image, headline title text, description text & link text as well as the URL the advert links to.

[%advert type:'text' ad_group:'' template:'' limit:'1'/%]
<div class="thumbnail">
    <a href="[@url@]"><img src="[%asset_url type:'adw' id:'[@ad_id@]'%][%param default%][%ntheme_asset%]img/default_product.gif[%/ntheme_asset%][%end param%][%/asset_url%]" width="[@img_width@]px" height="[@img_height@]px" alt="[@headline@]"></a>
    <div class="caption">
        <h4><a href="[@url@]">[@headline@]</a></h4>
        <p><a href="[@url@]">[@linktext@]</a></p>

Product adverts

[%advert type:'product' ad_group:'' template:'' limit:'1'/%]

The product tag operates similarly to the thumb_list tag when set to type and loading products, so for more information on how product thumbnails and tags work see the thumb_list page for more information

The advantages to using an advert tag instead of a thumb_list tag are for scenarios where you'd like to keep the content managed separately, both in your template & within Neto and where you'd like to take advantage of the date range built into adverts within Neto to only show the tag during a date range as entered into Neto.

category:'0' & You

When you create a new advert in neto, you'll be asked to place it in a content or category page & by default the advert tag will load this advert based on whether the advert you built has been assigned to both the content you are on & the appropriate advert group.

There are times when you won't want to have an advert tied to a specific content location, such as using adverts on an ebay template or having an advert in the header / footer of your site.

By adding the param category:'0' this assigns the advert to all categories, so you can leave it blank when you build the advert and it'll still show.

Dynamic Group Generation

Occasionally you may need to assign an advert to a specific place outside of just a specific category or page, such as on a product.

You can use data tags from your page to create advert groups dynamically, for example:

[%advert type:'text' ad_group:'top-of-page-[@sku@]' category:'0' template:'' limit:'1'/%]

Which means as this tag is loaded on each product page it'll generate the appropriate group each time it is loaded. You'll still need to create a new advert group for each SKU in neto and assign the advert to the appropriate group but then you can specify an advert per product.

Note that combining this with the category:'0' tag is a good idea as you'll be using your specific group to determine where it appears, less so it's location on a content page

if_empty Param

Adverts typically make up a large part of the layout on pages like the home page, meaning in cases where the adverts fail to produce results (The advert date runs dry, adverts have been removed, the site is yet to have the content put in, etc) you can use the if_empty param to create a fallback to keep your page layout intact.

A good example is loading random products when there are no featured products available, something we do by default on Skeletal's home page:

[%advert type:'product' template:'' limit:'8' ad_group:''%]
    [%param *header%]
        <hr />
        <div class="row">
    [%param footer%]
    [%param *ifempty%]
        [%random_products category:'0' template:'' limit:'8'%]
            [%param *header%]
                <hr />
                <div class="row">
            [%param *footer%]

Background images for better responsive adverts

Loading your advert into an <img> tag is a fine way to display your adverts for the most part, but there are lots of cases where adverts are a great solution to have lots of banner content to drive your site. In these cases, using CSS & the grid system can be the best way to let whomever builds the content for your site have a little flexibility determining what images to use while giving you more control to ensure the images behave the way you want them to.

So by loading the image into an inline style like the following:

<div class="nAdvertSample" style="background-image:url('[%asset_url type:'adw' id:'[@ad_id@]'%][%param default%][%cdn_asset html:'0' library:'images'%]default_product.gif[%/cdn_asset%][%/param%][%/asset_url%]')"></div>

You can then use useful flexible CSS properties to style your div :

.nAdvertSample {

Some quirks you should know about

When using adverts, there are a few things that might cause results that you might not expect. Two of the most common of these are :

There can only be one ad_group used per page. You can have multiple advert tags per page, but each one needs to have their own separate ad_groups, you can't use the same group twice.

Once a product thumbnail is loaded onto the page it won't load a second time in an advert tag. So if you have say a thumb_list that loads SKU123 and try to load that same SKU123 into your advert tag, it won't show.

Name Options Description
type:'' banner, text, product Identifies the type of advert to load from Neto
ad_group:'' String Name of ad group as it appears in Neto
template:'' String Used to determine the HTML template to use from the related thumbnails folder, when blank the default template template.html file is called.
limit:'' Integer Used to determine the number of adverts to display
category:'' String Identifies a specific content ID to load adverts from that are assigned to that ID. You can set this to category:'0' to load adverts that are not assigned to any specific page.
inherit:'' y, n Use this parameter to display the banner from a parent category or content page. For example: Example

In the diagram above, we have two categories. One is the sub-category of the other. Both have their own advert assigned to them.

  • If inherit:'y', the Sub-Category page will display both Advert 1 and Advert 2, because it will inherit all ads from it's parent content page.
  • If inherit:'n', it will only show Advert 2

inherit:'y' is the default, if it is not specified.

allow_duplicate:'' 1, 0

When trying to utilise the same advert multiple times on the same page, this parameter is required otherwise it will only output the first occurance.

allow_duplicate:'0' is the default, if it is not specified.

Name Description
[@url@] The URL specified by the options set-up in the advert in Neto
[@count@] A tag that will add an integer each time the array is run
[@ad_id@] The unique ID of the advert campaign
[@img_width@],[@img_height@] The height & width of the image size as determined in the campaign
[@headline@] The headline/title of the advert campaign
[@description@] For the advert type Text, loads the description block
[@related@] If the filter is currently related (1 = yes)
[@linktext@] For the advert type Text, loads the link text

Was this article useful?

Be notified when this page is updated. Optional.