Here’s an example of what I did: Immigration Lawyers | Buchanan Ingersoll & Rooney PC
So my goal here was to create a TV that could hold up to 3 sizes of images for different screen sizes (desktop, table and mobile). But I also set up the TV to allow multiple banner ads with separate placeholders if more than one ad was needed on a page.
For some odd reason, occasionally, the content just doesn’t load and it takes manually re-saving the resource to get it to populate. I’m hoping that someone will spot something wrong with my code to help me diagnose this issue.
In the InlineAdvertisement TV:
[{“caption”:“Advertisements”, “fields”: [
{"field":"AdLarge","caption":"Desktop Size","description":"Larger Size for small to large monitors","inputTVtype":"image","sourceFrom":"migx"}, {"field":"AdMed","caption":"Tablet Size","description":"Medium Size for tablets (optional)","inputTVtype":"image","sourceFrom":"migx"}, {"field":"AdSm","caption":"Mobile Size","description":"Small Size for phones","inputTVtype":"image","sourceFrom":"migx"}, {"field":"AdURL","caption":"Location to Link to","inputTVtype":"text"}, {"field":"AdTracking","caption":"Optional Tracking Code","description":"Starting with qestion mark (?)","inputTVtype":"text"}, {"field":"AdAlt","caption":"Alternate Image Text","inputTVtype":"text"}
]}]
In the Template:
[[*InlineAdvertisement:notempty=` [[getImageList? &tvname=`InlineAdvertisement` &tpl=`AdvTpl` &toSeparatePlaceholders=`adv` &placeholdersKeyField=`idx` ]] `]]
In the Chunk:
<a class="inline-advertisement" href="[[+AdURL]][[+AdTracking:notempty=`[[+AdTracking]]`]]" target="_blank" title="Click Here"> [[+AdLarge:notempty=`<img class="large" src="[[+AdLarge]]" alt="[[+AdAlt]]" />`]] [[+AdMed:notempty=`<img class="tablet" src="[[+AdMed]]" alt="[[+AdAlt]]" />`]] [[+AdSm:notempty=`<img class="small" src="[[+AdSm]]" alt="[[+AdAlt]]" />`]] </a>
Then, the user would just add [[+adv.1]] (or whatever number was next) to some point in the content editor of the page to place the banner.
Any advice would be appreciated.
Thx