Hi all,
i want to extend a blogentry with a picture. I tried this code:
in BlogEntry.php i wrote a new function:
function NewsImage() {
$actualBlogEntry = DataObject::get_by_id($this->ClassName, $this->ID);
if (var_dump(isset($newsImage["NewsPicture"]))) {
return true;
};
return false;
}
and in BlogEntry.ss
<% if NewsImage %>
<img class="newsimage" src="assets/newsimages/$NewsPicture" alt="$Title" title="$Title"/>
<% end_if %>
Unfortunately i can't access $actualBlogEntry as an array like $actualBlogEntry[NewsPicture].
When using print_r $actualBlogEntry i can see NewsPicture.
Is it somehow possible to access the Blogentrymember "NewsPicture"?
TIA Tom