Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kebabskal 27 posts 26 karma points
    Aug 11, 2010 @ 17:47
    kebabskal
    0

    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

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Aug 11, 2010 @ 18:28
    Sebastiaan Janssen
    0

    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.

  • kebabskal 27 posts 26 karma points
    Aug 12, 2010 @ 17:11
    kebabskal
    0

    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

  • kebabskal 27 posts 26 karma points
    Aug 18, 2010 @ 11:56
    kebabskal
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft