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:

$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

alexaalto
 
studio108 replied on at Permalink Reply
studio108
alexaalto replied on at Permalink Reply
alexaalto
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
alexaalto replied on at Permalink Reply
alexaalto
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