Back to ProEvents Support

imunisasi
imunisasi

Hello,

How to show featured image ? it wont appear on event list

Thank you

info4820
info4820

I am having the same issue. I can add a featured image but I can't seem to get it to show anywhere.

kyle5395
kyle5395

Please make this available!! Very important feature for my current client and seems a little silly to have the field on the back-end and not be able to access it.

Before a full update anyway you can provide some code to add this to the event_item model, I really need it?

Thanks,

kyle5395
kyle5395

Solution here.... but wont persist when plugin updated.

in Radiantweb/Proevents/Components/Event.php add...


1) $this->event = $this->page['event'] = $this->myEvent(); (to the onRun() function)

2) public function myEvent(){ $event = EventModel::where('id','=',$this->param('event_id'))->first(); return $event;


Then access your Featured Images like this...

img src="{{ event.featured_images.0.path }}"

img src="{{ event.featured_images.1.path }}"

The 0 and 1 represent the index of your Featured images. (I cut off the img html syntax because I have no idea how to use the code markdown in here.)

~ Kyle

Last updated

keystroke
keystroke

Instead of modifying the plugin, override the "plugins/radiantweb/proevents/components/event/default.htm" file by creating "themes/yourthemefolder/yourComponentAlias/default.htm" based on the original file.

Or you can simply just add your images to the page markup....

{% if event_item.event.featured_images.count %}
    {% for image in event_item.event.featured_images %}
        [img src="{{ image.path }}"]
    {% endfor %}
{% else %}
No images
{% endif %}

Last updated

imunisasi
imunisasi

@keystroke thanks btw this one can go on octobercms RC ?

imunisasi
imunisasi

both sollution not worked anymore :(

@kyle>kyle5395 said:

Solution here.... but wont persist when plugin updated.

in Radiantweb/Proevents/Components/Event.php add...


1) $this->event = $this->page['event'] = $this->myEvent(); (to the onRun() function)

2) public function myEvent(){ $event = EventModel::where('id','=',$this->param('event_id'))->first(); return $event;


Then access your Featured Images like this...

img src="{{ event.featured_images.0.path }}"

img src="{{ event.featured_images.1.path }}"

The 0 and 1 represent the index of your Featured images. (I cut off the img html syntax because I have no idea how to use the code markdown in here.)

~ Kyle

keystroke said:

Instead of modifying the plugin, override the "plugins/radiantweb/proevents/components/event/default.htm" file by creating "themes/yourthemefolder/yourComponentAlias/default.htm" based on the original file.

Or you can simply just add your images to the page markup....

{% if event_item.event.featured_images.count %} {% for image in event_item.event.featured_images %} [img src="{{ image.path }}"] {% endfor %} {% else %} No images {% endif %}

surfreuse13307
surfreuse13307

@keystroke solutions works well in Event Component, but I would like to access featured_images in EventList, its seems that the events variable comes without featured_images (null). Is there a simple way to get featured_image in EventList component to show them.?? Thanks

Last updated

1-8 of 8