One of the most important strengths of the eXo Platform is the user experience. The end user can create new content using the content management system. Today, I’ll show you how easy it is to add a News Slider in only five simple steps. It’ll take only five minutes of your time. Follow the tutorial below and enjoy!
Tutorial (5 minutes)
Installation in five steps
1. Cloning a project
- Go to the GitHub repository exo-addons/news-slider and clone the project.
2. Adding resources
- Go to the back office of the eXo Platform (using File Explorer).
- Add a content folder ( for example) to store the news items (for example under ). You can add news using the template. Add an image and a summary, which will be displayed as the preview in your News Slider. For testing, we will use , so import it into your file system.
- Upload the CSS file into any location (for example, under ) and copy its path .
- Upload the JS files and (which are the jQuery libraries) to any location (for example, under ) and copy the path .
3. Update the resource paths
- Go to the template file and update the paths of the resources, that is the JS and CSS files (already saved in and ). Paste the exact paths into the parameter:
- If you haven’t copied the paths, then go back to the files in and , right click on a file, select the final menu entry and then paste them as above.
- Ensure that the path is not a private link so that the news can be viewed by guests (if it is private delete from the path).
<link rel="stylesheet" type="text/css" href="/rest/jcr/repository/collaboration/sites content/live/shared/css/NewsSlider.css" media="all">
4. Add the template via the IDE
- Go to the IDE, select the workspace and navigate to .
- Add a new template.
- Copy and paste the content of the GTMPL file into this template and save it as .
5. Add the CLV and configure it
- Now we are ready to add our News Slider to a website.
- Go to a website, ACME for example, edit the layout and add a new portlet ( ) to a page.
- Edit this content list portlet. Configure it by selecting the news folder path (in our case ) and select the new CLV template created above: .
- It’s possible to configure the slider depending on the amount of news and whether it is broken into pages.