Need some Assistance - Accordion Block with Images

Permalink
Good day all-
I'm attempting to add some functionality to the Vivid Simple Accordion package. Since this plugin hasn't been well support by the developer I thought i'd have a go at modifying it.

I'm trying to add an image feature for each possible accordion block.

At the moment, i think i have everything setup (the form.php, db.xml, view.php, and database table) but i'm unable to save. I don't get any errors, issue is the save button doesn't work when the image field is added to form.php.

I've attached the modified block for anyone interest in lending assistance :)

1 Attachment

edgedesign
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi edgedesign,

I believe you need to call the concrete5 file manager using JavaScript when using Underscore templates.

I recommend reviewing how the Image Slider block handles accessing the concrete5 file manager.
https://github.com/concrete5/concrete5/blob/develop/concrete/blocks/...
edgedesign replied on at Permalink Reply 1 Attachment
edgedesign
Thanks for response MrKD,
I am able to open the filemanager and select an image and the fID is showing in the form's hidden field for "imgID".

As mentioned, the issue comes when saving the changes. I have attached a couple screenshots.


**UPDATE**
I reviewed the image_slider scripts and was able to sort out loading the images for each accordion block and repopulating the form.php. Thanks MrKDilkington.
I have attached the block if anyone wants to expand, or tweak, what i've done.
JohntheFish replied on at Permalink Reply
JohntheFish
Magic Tabs also does accordions and you can put anything in a tab.
https://www.concrete5.org/marketplace/addons/magic-tabs1/...
mnakalay replied on at Permalink Reply
mnakalay
One problem is, the way you do it, all your image selectors get the same input name so only the last one might be saved.

But the biggest problem is, they will all get the same ID attribute and since the image selector relies on JavaScript, having several times the same ID will break it.

You should do as MrKDilkington suggested and look into the core image slider block