Yes, if you want a rotating banner than the correct approach is to set them all with the same priority. There is nothing special about the priority '1', just that when you pull back all of the content items within Thymeleaf they are sorted by the priority (lowest priority first).
So, if you had 5 banner ads that had these priorities:
1, 0, 3, 2, 8
And you were just displaying a single item, that first item would ALWAYS be the content with a priority of 0. If you changed it like this:
0, 0, 3, 2, 8
Then the system would randomly determine which 0-priority content item to display.
That said, you could also get the entire list and pick yourself which one to display, or do a rotating banner which some have also done. This is done basically like this with the 'contentItems' variable that the blc:content processor returns:
Code: Select all
<blc:content contentType="Homepage Banner Ad" />
<div id="banners" th:if="${contentItem !=null and contentItem['targetUrl'] != null and contentItem['imageUrl'] != null}">
<ul>
<li th:each="${item} : contentItems">
<a th:href="@{${item['targetUrl']}}"><img th:src="@{${item['imageUrl']}}" /></a>
</li>
</ul>
</div>