In this article I have explained how to configure and use Image rendition feature in publishing site collections.
– Image rendition helps to display the image with different height and width of the same image on different pages in a publishing site.
– When you create an image rendition, you specify the width and/or height for all images that use that image rendition.
– Image renditions are available for all the images upload into the sharepoint libraries.
Prerequisites for image renditions:
– BLOB Cache
Now let’s go and see how to enable cache settings for a web application
Open IIS Manager
Navigate to the IIS web site -> Click Explore
Also you can read few articles on:
– Configure app environment and create a app in sharepoint server 2013
– Create a chart using chart.js In sharepoint server 2013
– Document approval workflow in SharePoint 2013
Open Web.config file
Find the below line
<BlobCache location=”C:\BlobCache\14″ path=”\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|themedbmp|themedcss|themedgif|themedjpg|themedpng|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv|ogg|ogv|oga|webm|xap)$” maxSize=”10″ enabled=”false” />
Set Enable = “True”
<BlobCache location=”C:\BlobCache\14″ path=”\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|themedbmp|themedcss|themedgif|themedjpg|themedpng|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv|ogg|ogv|oga|webm|xap)$” maxSize=”10″ enabled=”true” />
Now the cache settings is successfully enable under web application
– Publishing site collection / Publishing feature enabled site
First steps let’s create a publishing site collection.
After successful creation of publishing site collection.
Enable Sharepoint publishing features under site collection features and manage site collection feature
– Asset library
Asset library is useful for storing rich media assets for example images, videos and audio files
On site settings -> Click Add an app -> Pick Asset library template app
Next step let’s go and creating image rendition
Open site settings -> Under look and feel -> Click Image rendition
Provide the width and height of the image rendition
So now the Image rendition has been created successfully
“logo” has been successfully created
Edit Image rendition
Click on the Edit icon
Change the given width and height of the created rendition and click Save
So now the image rendition has been “Edited” successfully.
Let’s go and upload a sample image into asset library and pick the rendition
After successful upload of image -> Click Edit renditions
So the rendition has been created successfully for the uploaded image automatically
You can also “Crop the image” using Click to change option below image
Crop it and Click Save
In the ribbon tab also you can also edit rendition option while selecting the image
Next step how to use image rendition in sharepoint page
Click on site action gear icon -> Add page
On the page content
Click on the top ribbon to insert picture from the following options
On the Image tab -> Pick Rendition
Click Save -> Publish
So as of now you can able to use the same image with different height and width on different pages using this feature.
How to use the Image rendition on image tag
<img src=” /sites/imr/PublishingImages/17457619_1377913145602400_6065847167570624938_n.jpg? RenditionID=5” />
Happy learning !……