Adding photos to survey block?

Permalink
Would there be an easy/semi-easy way to add images to the survey block, kind of like a photo voting contest thing? I am no php ninja but I can fumble my way through a little bit of tomfoolery.

braincramp
 
jordanlev replied on at Permalink Reply
jordanlev
Do you just need some static images on a certain survey block, or does the site owner need to be able to set different images for different blocks, or do you need the people filling out the survey to be able to upload photos?

Option 1 is easy -- just create a custom template for the survey block and hard-code some image tags into it.

Option 2 would require a lot more tomfoolery -- you'll want to look at the code for the image block and see how that allows for image selection in the editing dialog and add something like that to the survey block -- you'll also need to add a database field in db.xml for the file id (and refresh the schema via the dashboard to have the schema change take effect on the database). This would be a decent amount of work though.

Option 3 is even more work than 2. I'm not sure how it would work -- although I think there's a file upload option for the form block -- maybe you could just use that instead of survey?
artyom replied on at Permalink Reply
artyom
Why not just create a custom image attribute, and then find a way to render with a custom template? (or is this what you mean by "hard code" in option 1? )

Then you get your image adding selection for free.
jordanlev replied on at Permalink Reply
jordanlev
Custom image attributes are assigned on a per-page basis, but this is a block. I guess you could go this route but I think it would be hard to understand for the user when editing content.

But if there's only going to be a single survey block on each page and the person editing content doesn't mind the non-standard process and you're tight on time/budget, this could be a workable compromise.