Pull image attribute from page using a page list
Permalink
Hi
I have created a page list on a courses landing page to show all courses.
I have got it showing the name and description of each but having trouble having it pull through each page's custom attribute I created which is used for the hero banner on each page.
On the child page the attribute is an image/file and shows the image in the hero, this is the code on the child page
<?php $banner_image = $c->getAttribute('banner_image'); ?>
<div class="page-hero"<?php if($banner_image) { echo 'style="background-image: url('.$banner_image->getURL().')"'; } ?>>
The above works great. Is there a way to show this image in the page list without having to add in a thumbnail image on each child page (basically having the user add the same image twice)?
Sorry if this is a basic question. I am learning concrete5 currently.
I have created a page list on a courses landing page to show all courses.
I have got it showing the name and description of each but having trouble having it pull through each page's custom attribute I created which is used for the hero banner on each page.
On the child page the attribute is an image/file and shows the image in the hero, this is the code on the child page
<?php $banner_image = $c->getAttribute('banner_image'); ?>
<div class="page-hero"<?php if($banner_image) { echo 'style="background-image: url('.$banner_image->getURL().')"'; } ?>>
The above works great. Is there a way to show this image in the page list without having to add in a thumbnail image on each child page (basically having the user add the same image twice)?
Sorry if this is a basic question. I am learning concrete5 currently.