Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

ComplexTableField with Images


Go to End


2 Posts   2610 Views

Avatar
jjeziorski

Community Member, 11 Posts

16 September 2008 at 10:47pm

Hey,

What I'm trying to get is a ComplexTableField with thumbnails of images (as table column) and some string columns in CMS tab. I don't really need to upload images, i just need a preview of images, since i'll need this to add descriptions to images.

My ideas for solution:
1. Pass Image data (URL, width, height) as a string to CTF and interpret data through custom template. (how to get this data from Image datatype, defining CTF?)
2. Override CTF item rendering method (but i haven't a clue where to start)

Any ideas, suggestions?
Thanks,

Avatar
Laax

Community Member, 14 Posts

19 November 2008 at 1:19am

Hi,
I already succeed doing this before.. but it was as a test and i deleted the code after.
But, as a tiny clue, here are some tracks I followed:
- (php) extending the ComplexTableField php class
- redecorating the same class (see: dataobjectdecorator)

As far as I remember I finished by redefining an .ss file that renders the table in the CMS (found a post on the forum on how to do it) and extending the php class in order to add a function that returns an Image dataobjectset so that I could loop on it in the ss file.

Hopes that helps.