Page 1 of 1

blc:content Tag Not Working Properly

Posted: Fri May 31, 2013 4:39 pm
by vcatalano
I am attempting to create a carousel banner with the following code:

Code: Select all

<blc:content contentType="Carousel Banner" />
  <ul id="hero" class="slides">
    <li th:each="item : contentList" class="hero-slider">
      <img th:src="@{${imageUrl}}" width="1084" height="597" />
      <p><em class="merri">Much more than pills,</em><br />
      IT’S A PERSONAL LIFESTYLE PROGRAM.</p>
    </li>
</ul>


I have created many structured content pieces of the "Carousel Banner" content type. However, I receive the following exception when I attempt to render view the page:

Could not parse as each: "item : contentList"


Has something changed with how the bcl:content tag works?

Re: blc:content Tag Not Working Properly

Posted: Fri May 31, 2013 5:03 pm
by vcatalano
The post here was misleading: viewtopic.php?f=14&t=1826&p=4961&hilit=contentList#p4961. I had been using that code to go off of for my own stuff. Here is the code that works:

Code: Select all

<ul id="hero" class="slides">
  <li th:each="item : ${contentList}" class="hero-slider">
    <img th:src="@{${item[imageUrl]}}" width="1084" height="597" />
  </li>
</ul>


Apparently contentList needs to be evaluated withing the th:each tag.

Re: blc:content Tag Not Working Properly

Posted: Fri May 31, 2013 9:29 pm
by phillipuniverse
Yup, that was a typo. I've edited the referenced post. Thanks for the report!