Custom Attributes from Calendar Event in Custom Template
Permalink
I have successfully associated a custom "event_image" attribute to events to the built in Calendar in Concrete5.8.3. From my research, I should be able to access the image using code like:
However $img is never set. It seems that no custom attributes are set in the resulting $event object in the /concrete/blocks/event_list/view.php file (which I'm overriding via a template).
The documentation in this area is sparse - would any one have any clues? Do I need to "refresh" the attributes somehow with "Express"?
Many thanks in advance!
Cheers,
Alex
$img = $event->getAttribute('event_image');
However $img is never set. It seems that no custom attributes are set in the resulting $event object in the /concrete/blocks/event_list/view.php file (which I'm overriding via a template).
The documentation in this area is sparse - would any one have any clues? Do I need to "refresh" the attributes somehow with "Express"?
Many thanks in advance!
Cheers,
Alex
Thanks for the response Studio108.
As I mention below, it seems to be slightly buggy behaviour in the attributes: I theorize that adding a single attribute (file/image) without a set, which I then went back and added to a set, may have caused this. When I added a second attribute (text), both attributes suddenly appeared.
In any event, everything is working now and I manage to accomplish making a custom template.
Cheers,
Alex
As I mention below, it seems to be slightly buggy behaviour in the attributes: I theorize that adding a single attribute (file/image) without a set, which I then went back and added to a set, may have caused this. When I added a second attribute (text), both attributes suddenly appeared.
In any event, everything is working now and I manage to accomplish making a custom template.
Cheers,
Alex
So this was sort of a false alarm. I went back and added a new attribute and suddenly all the attributes started to appear so I could accomplish my goal.
While there is some buggy behaviour (i.e. the first attribute was not coming through in the $event object), it's now working. If anyone is curious, I am thinking this happened because I initially added the the attribute without a set.
Cheers,
Alex
While there is some buggy behaviour (i.e. the first attribute was not coming through in the $event object), it's now working. If anyone is curious, I am thinking this happened because I initially added the the attribute without a set.
Cheers,
Alex
https://www.concrete5.org/community/forums/customizing_c5/how-to-out...