I'm looking at implementing context engine and SDL Mobile in a new build.

I see the simplicity of serving the correct image file per device should I have an image from a component imagefield, but if a user embeds a large image file in the middle of an RTF, this is going to be difficult to display.

How have people so far handled this scenario? My leading thought so far is to do some template magic to wrap the image tag with some context tags.

  • Are you trying to deliver the images re-sized using Contextual Image Delivery? Commented Jul 28, 2014 at 23:00
  • Who or what should control the image resizing logic (authors, template code, or the application)? And do you have any image path naming requirements? Commented Jul 31, 2014 at 1:22
  • @ChrisMorgan - yes, we're hoping to use SDL's tools here.
    – johnwinter
    Commented Jul 31, 2014 at 5:20
  • @AlvinReyes - When an image is entered, it is entered in it's high res state, the CMS functionality handles the rest.
    – johnwinter
    Commented Jul 31, 2014 at 5:20

1 Answer 1


John - your approach for doing some template magic sounds the right direction. You can replace the image URL with something like

<img src="/cid/scale/<context:Eval runat="server" Expression="ui.thumbnailSize"/>/source/images/snow.png" />

Where ui.thumbnailSize is defined in the context vocabulary as an expression e.g. define

 <aspect name="ui">
     <property name="thumbnailSize" type="Integer" 
       expression="if ( browser.displayWidth lt 640 ) { 50  } else { 100 }"/>

in cwd_engine_vocabulary_conf.xml. Then in cwd_engine_conf.xml define where the source images points to, e.g.

  • thanks @ian - just wanted to validate with this community first.
    – johnwinter
    Commented Aug 1, 2014 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.