Hello,
I have this simple code that throws errors
I put in an echo (to test) of the url call on the file (line 5), it throws:
/voetvolk.be/site/assets/files/1016/grande_guide_to_lead_nurturing.pdf
"Notice: Trying to get property of non-object in ......."
Weird thing, the path is outputed as you can see, but I'm getting these errors
The $snippet->press_date and $snippet->title are showing up, no problem here
The file field press_snippet is a single file field.
<?php
$press = $pages->get("/press/")->find("press_project=$page->id");
echo "<h3>Press</h3>";
echo "<table>";
foreach($press as $snippet) {
echo $snippet->press_snippet->url;
?>
<tr>
<td><a href='<?=$snippet->press_snippet->url?>' target='_blank'><img src='<?php echo $config->urls->templates?>img/<?=$snippet->press_snippet->ext?>_icon.png' alt='<?=$snippet->press_snippet->get('description|name')?>' title='<?=$snippet->press_snippet->get('description|name')?>' width='24' height='31'/></a></td>
<td><?=$snippet->press_date?><br/><?=$snippet->title?></td>
</tr>
<?php
}
echo "</table>";
?>
It's probably someting stupid, but I'm not seeing it
Thanks
S.