Hello,
I implemented the search of dataobjects to my site. The search works, here is the search form´s action method:
function doSearch($data, $form) {
$StudioPostcodeQuery = $data['StudioPostcodeQuery'];
$id = $this->ID;
$StudioSearchResults = DataObject::get('FitnessStudio', "FitnessStudio.campaignID = '$id' AND FitnessStudio.postcode = '$StudioPostcodeQuery'");
$data = array(
'Results' => $StudioSearchResults,
'Title' => 'Surchergebnisse'
);
return $this->customise($data)->renderWith(array('StudioSearch_results', 'Page'));
}
The results template looks like this:
<div class="typography">
$Title
<% if Results %>
<ul id="SearchResults">
<li>hrhrhr</li>
<li></li>
</ul>
<% else %>
<p>No results found.</p>
<% end_if %>
</div>
How can I call attributes of the dataobjects in the results template?