Hi, I have a dataobject with Points of interest called PointOfInterest.
Now I wand the client to be able to add it to a page with a shortcode
So in the _config.php I added
ShortcodeParser::get('default')->register('FeaturedPOI', array('StandardPage', 'FeaturedPOI'));
Then to the StandardPage.php I added
class StandardPage extends Page {
public static function FeaturedPOI(){
$PointOfInterest = PointOfInterest::get()
->filter(array(
'Active' => true,
'Featured' => true,
));
return $PointOfInterest->renderWith('FeaturedPOI');
}
}
And I created a FeaturedPOI.ss Include
<% loop $PointOfInterest %>
<div class="prest_cont">
<img src="$Photo.URL" class="img-responsive pull-left img-rest">
<div class="prest_block">
<div class="Name">$Name</div>
<Address>
$Address, $City, $State $Zip<br>
$Phone<br>
<% if $Website %>Website: <a href="$Website" target="_blank" class="dot_under">click here</a><% end_if %>
</Address>
<div class="Disc">$Description</div>
</div>
</div>
<% end_loop %>
The shorcode works it runs the FeaturedPOI function
If I do a Debug::show($PointOfInterest); within the FeaturedPOI function I see that it has 3 items
I see it gets the template but the look in the template is not working.
Where do I go wrong? Any ideas?