Login

Function for managing captions in EPiServer

Versions: 4.6x, FAQ number: 200, Old FAQ number: 13251

Question:

Is there a built in function for creating and adding image captions in EPiServer CMS?



Answer:

No. Currently the easiest way is to use tables placing the image in a cell and the caption in another cell, to control the appearance and the text flow around the image. Another alternative is to create a page template where you make it possible to manage images with captions.

Below you will find an example of a text with an image and caption, based on a table with one row and two columns. The settings for table properties, together with a column width of 33%, will provide the result below.


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc cursus. Aenean sed metus in dolor vestibulum consectetuer. Nullam ac diam. Ut blandit velit id lorem. Duis erat. Ut nec tellus ut tortor dictum pulvinar. Aenean sed metus in dolor vestibulum consectetuer. Aenean sed metus in dolor vestibulum consectetuer. Nullam ac diam. Nunc cursus. Aenean sed metus in dolor vestibulum consectetuer. Consectetuer aenean sed metus in dolor vestibulum consectetuer.

Fig 1. Fusce aliquet magna

Another way is the development of a page template with functionality for adding an imgae with a caption. Using a so called definition list in the page template, and then adapting the layout using CSS rules, is one solution for coding the template.

Programming exampel:
.
.
.
<dl>
  <dt><img /></dt>
  <dd>Caption1</dd>
</dl>
.
.
.

 

EPiTrace logger