Image scale demo

/dev-demo/.content/images/375px-Inflatable_structure_in_Bad_Schallerbach.jpg This example demonstrates how to scale the size of an image dynamically. The image scaling depends on the width of the container, in which this article is dropped.

Dynamic image size demo

/dev-demo/.content/images/800px-Wernigerode_Laga_1.JPG

This example demonstrates how to scale the size of an image dynamically. The scaling depends on the width of the container, in which this article is dropped.

The image size is set dynamically inside of the formatter using container width. You have to define the container width as an attribute of the <cms:container> tag inside of the template. Then you can access the container width inside of the formatter.

 

Please check following formatters to get more implementation details:

/system/modules/org.opencms.dev.demo/formatters/article/center.jsp

/system/modules/org.opencms.dev.demo/formatters/article/side.jsp