Click here to Skip to main content
15,889,992 members
Articles / Web Development / CSS
Tip/Trick

Create Slider Webpart in Sharepoint 2013 Without Writing Custom Code

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
6 Jul 2016CPOL1 min read 15K   407   3   3
This tip describes how to create a slider webpart in SharePoint 2013 without writing any custom code.

Introduction

This tip will help you to create a custom slider webpart without writing any custom code. The content of the slider webpart can be changed dynamically.

  1. Add Jquery reference in the page.
  2. Create a text file with slider content and upload it in style library.
  3. Render the text file in the page by using content editor webpart.

Outline of the Slider Webpart

When you open the page, image 1 will be selected and content 1 can read the user.

Image 1

If you want to read content 2, click on image 2.

Image 2

Similarly, you can see content 3.

Add Js Reference in the Home Page

I used the following jquery file to build this webpart

  • slider.js
  • cycle.js
  • slider.css

Open the page where you want to add this webpart, and add the following js and css reference in the header section.

XML
<SharePoint:CssRegistration name="&lt;% 
$SPUrl:~sitecollection/Style Library/css/slider.css 
%&gt;" runat="server"></SharePoint:CssRegistration>
<SharePoint:ScriptLink ID="ScriptLinkscrol12" 
Name='~SiteCollection/Style Library/JS/slider.js' runat="server"/>
<SharePoint:ScriptLink ID="ScriptLinkscrol14" 
Name='~SiteCollection/Style Library/JS/cycle.js' runat="server"/>

Create a Text File with Slider Content

In the below code, outline of slider content, save the content as text file "HomePageWepbart.txt" and upload it in style library.

HTML
<div class="featured_content">
<ul id="accordion" 
style="position: relative; overflow: hidden; ; height: 250px;">
<li class="current" style="position: absolute; left: 0px; 
z-index: 4; height: 250px; width: 823px;background-image: 
url('../Style%20Library/JH/Images/divbackground.jpg');">
<div class="featured_box">
<h2>1. Title here</h2>
<p>
Cotnent Here
</p>
<p class="readmore"><a href="#" 
id="CRWhatsnew">Continue Reading »</a></p>
</div>
<div class="featured_tab" style="background-color:#FF9E19">
<img id="whatsNew" alt="What’s New?">
<p>What’s New?</p>
</div>
</li>
</ul>
</div>

Render the Content by Using Content Editor Webpart

Follow the below steps to render the content in content editor webpart.

  1. Add Content Editor webpart in the page
  2. Edit webpart properties, give text fie path in content link text box
  3. Finally Press "ok" button

Image 3

History

  • 5th July 2016 - Inital version created.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
India India
I am Senthil Gopal, a SharePoint Lead based out of Chennai, India.
I have around 9+ years of experience in Microsoft technologies such as C#,Asp.net, SharePoint 2010 and 2013.
This is a Social Group

4 members

Comments and Discussions

 
Bug[My vote of 1] Hard coded images. Really? Pin
Member 44364114-Jan-18 14:35
Member 44364114-Jan-18 14:35 
GeneralRe: [My vote of 1] Hard coded images. Really? Pin
senthill1-Feb-18 17:15
professionalsenthill1-Feb-18 17:15 
BugHard coded images. Really? Pin
Member 44364114-Jan-18 14:35
Member 44364114-Jan-18 14:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.