Hi Guys,
I am struggling a little with this... Obviously it is going to be a really simple answer, but I just can't crack it at the moment.
I am creating a browse page with ajax links to show more items.
So I have the AJAX working fine but my main problem is that I can get the dataobject to actually pass information through to the new template I a calling with renderWith(). I have tested and there is info in the dataobject it is just my lack of understand which value I should be using in the template I think
Function to return a list of books
public function books() {
$books = DataObject::get('Book', "ItemType = 'have' AND Status = 'available'", 'Created DESC, Value DESC', '');
return $this->renderWith('BrowsePage_Books');
}
Template = BrowsePage_Books.ss
<div id="AllBooks" class="categoryBoxes">
<h2>Latest Books <a href="">View all Books</a></h2>
<ul id="ProductListing" class="productListing">
<% control Book %>
<li class="$FirstLast">
<a href="" class="productImage">
<% control ItemImage1 %>
<img src="$CroppedImage(104,104).URL" alt="$Title" class="entry-image" />
<% end_control %>
</a><br/>
<p class="productTitleContainer"><a href="" class="productTitle">$Title :: $Author</a></p>
<a href="" class="getItemLink">Get Item</a>
</li>
<% end_control %>
</ul>
<div style="clear:both;"></div>
</div>
I saw this post and so I tried [url=http://www.silverstripe.org/template-questions/show/15204]http://www.silverstripe.org/template-questions/show/15204
<% control Me %>
But still no luck... Obviously I am just not in the right context, but struggling to work out which context I should be in... Any help appreciated.
Thanks,
Colin