I’m trying to add the ideal image slider to my hero section of the home page.
In the static HTML I get it to work (didn’t change anything on the iis js or code in general):
I tried to make a dynamic Version, where I can change the images in the panel, but since my PHP knowledge is not very good, I rather struggle doing so.
My blueprint for the panel looks like this:
title: Home
icon: home
pages:
template:
- module.accordion
files:
sortable: true
fields:
titlecaption:
label: caption title
type: text
caption:
label: caption
type: textarea
fields:
title:
label: Title
type: text
HomeGalSettings:
label: Home Slider Settings
type: headline
HomeGallery:
label: Gallery images
type: checkboxes
options: images
columns: 3
And the PHP I tried to get this to work looks like this:
This should replace the code from the static site I have.
The thing is: nothing happens. Just white space, no errors, but no images either. And to be honest: since I don’t really know what I’m doing, I copied and modified the PHP code from another slider that is working and does it basically the same way.
If anybody has any idea how to get it to work, I couldn’t thank you enough - I’m trying for two days now and I’m almost at the point of just leaving it how it is.
But, don’t call url() (or any other method) before testing if the object (in this case the image) exists (I can’t repeat that often enough, I’m afraid!)
thank you so much for the quick replies!
I used texnixe’s code which now gets the slider to show up, showing the caption I entered in the panel but the images can’t be loaded somehow. No errors, just a loading bar.
Yeah… that’s it. I gotta say, that’s a bit embarassing Especially since I changed that yesterday to src but apparently got mixed up in a different version…