You could use dictionary items for this. In the dictionary item you just use an <img> tag instead of text. But that won't be viable if the images need to change pretty often. Maybe a custom datasource would do the trick, but I'm not familiar enough with Contour to be sure about that.
The dictionary item method doesnt sound simple enough for my users.
However I am looking into creating a custom field type. I have gotten so far as to get a TinyMCE editor up through a RenderPreviewWithPrevalues override.
Not really got any ideas on how to save the things entered here...
It's not elegant but my temporary solution looks like this:
I create a Content Node which has a Rich Text Field that contains my images and/or text; I enter the node id for that node as the first prevalue on my a field with my custom FieldType.
Then I do something like this in the Editor property of my special fieldtype:
Images in questions and answers in Contour
Hello!
I'm evaluating whether Contour is a good fit for a customers website.
They have asked me to make a Survey tool for them to use to pick their visitors brains :)
Sounds like a job for Contour right?
One of the big uses for this should be to let the visitors choose between different designs of for example a product packaging.
For this we would have to show images. Is this possible in Contour?
Thanks in advance!
/Hannes
You could use dictionary items for this. In the dictionary item you just use an <img> tag instead of text. But that won't be viable if the images need to change pretty often. Maybe a custom datasource would do the trick, but I'm not familiar enough with Contour to be sure about that.
The dictionary item method doesnt sound simple enough for my users.
However I am looking into creating a custom field type.
I have gotten so far as to get a TinyMCE editor up through a RenderPreviewWithPrevalues override.
Not really got any ideas on how to save the things entered here...
If anyone have any suggestions I'm all ears :)
/Hannes
Ok, so I have now hacked around this problem.
It's not elegant but my temporary solution looks like this:
I create a Content Node which has a Rich Text Field that contains my images and/or text;
I enter the node id for that node as the first prevalue on my a field with my custom FieldType.
Then I do something like this in the Editor property of my special fieldtype:
PreValue prevalue = AssociatedField.PreValueSource.Type.GetPreValues(AssociatedField)[0];
item = new Item();
item.Field = "body";
item.NodeId = prevalue.Value;
return item;
This returns an Item which show the stuff from my Content Node.
I also override the Values property and return an empty list.
I hope I'll figure out a way to do this more elegantly. But deadline today so It'll have to do for now :)
/Hannes
is working on a reply...