I was following CMS tutorial, and managed to make RightHandSideBanner Ad work as BLC demo site works.
Now I have a more complex request. I need to have 4 images and 4 URL links as description of ONE banner space.
Client has an idea to use carousel to rotate those images.
I was thinking about solution to have one more complex BLC_FLD_GROUP with 8 BLC_FLD_DEF (2 fields per image representing image url and URL link that correlates that image)
Then I would have e.g. 'Carousel banner' as BLC_SC_FLD_TMPLT and ofcourse BLC_SC_FLDGRP_XREF, BLC_SC_TYPE, BLC_SC, BLC_SC_FLD and BLC_SC_FLD_MAP that follow that NEW field group definition.
In HTML, stuff stays the same, <blc:content contentType="Carousel Banner Ad" />
and then I would have something like:
Code: Select all
<ul id="slider">
<li>
<a th:if="${contentItem}" th:href="@{${contentItem['banner1_targetUrl']}}"><img th:src="@{${contentItem['banner1_imageUrl']}}" /></a>
</li>
<li>
<a th:if="${contentItem}" th:href="@{${contentItem['banner2_targetUrl']}}"><img th:src="@{${contentItem['banner2_imageUrl']}}" /></a>
</li>
...
I think that this should work.
But I was thinking about more elegant solution.
E.g. Anyway all fields are same. They all have: imageURL and targetURL. But I have them four instead of just one. Is there maybe some solution to iterate through contentItem, e.g. JSTL c:forEach ???
Or I expect too much?
Thank You