Introduction
This article deals with integrating a simple jQuery carousel plugin called iCarousel into ListView webpart using Client-side Rendering Model.
You should have prior knowledge of CSR basics before you go through this article.
Step 1
Place all the necessary JavaScript files and CSS files into Site Assets library.
- Navigate to the Site Assets library in your site collection.
- Create a folder named JS. This is to place all the JS files.
- Create another folder named Style. This is to place all the stylesheet files.
- Create another folder named Images. This is to place all the images.
For this example, I have used jCarousel plugin.
The JavaScript files required for this carousel are
- Jquery.min.js
- JCarousel.Basic.js
- Jquery.JCarousel.min.js
The stylsheets required are,
- JCarousel.Basic.css
Place the files in the respective folders within the Site Assets library.
Step
2
Create the List with the content for which the carousel needs to be shown. I have created a Cars List as below with 4 columns.
- CarName(Single Line of Text Column)
- ShortDescription(Single Line of Text Column)
- LongDescription(Multiple Line of Text Column)
- CarImage(Hyperlink or Picture column)
Create a new page and add the above Cars List as a web part to the page.
- Click on Edit
- Click on Insert Tab and Click on web part
- Select the Cars list from the Apps Category
- And Add
- Click on Save
Now, the page will look as below which is the default rendering of the ListView webpart.
subash vPosted May 17, 2017, 5:14 AM
Thanks benson, this helped us to complete the task