page_list page attribute download
Permalink
hi im trying to create a page attribute file download link on the page_list block.
but i get this
Fatal error: Call to a member function getVersion() on a non-object
i cant seem to figure out whats wrong any ideas ?
thanks
echo '<a href="' . $page->getAttribute('download')->getVersion()->getRelativePath() .' ">Download NOW</a>';
but i get this
Fatal error: Call to a member function getVersion() on a non-object
i cant seem to figure out whats wrong any ideas ?
thanks

Try $c or $cobj in place of $page see if that gets what you are looking for.
many thanks
<?php if($cobj->getAttribute('download')) { echo '<a href="'. $cobj->getAttribute('download')->getVersion()->getRelativePath() .' ">Download file</a>'; } ?>