https://github.com/james2doyle/pico_slider
create sliders inside the Pico CMS by listing the images in a folder
https://github.com/james2doyle/pico_slider
Last synced: about 1 year ago
JSON representation
create sliders inside the Pico CMS by listing the images in a folder
- Host: GitHub
- URL: https://github.com/james2doyle/pico_slider
- Owner: james2doyle
- Created: 2013-07-10T14:38:30.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-07-26T19:38:44.000Z (almost 13 years ago)
- Last Synced: 2025-04-02T22:33:06.240Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 82 KB
- Stars: 14
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
pico_slider
===========
Create sliders(image lists) inside the [Pico CMS](http://pico.dev7studios.com/).
### Use Cases
This plugin really just reads images and outputs them in an array to be used on the front end. You could use any slider library that you want really. I like Swipe because I just find it to be the best since there is no jQuery required and it works amazingly well on mobile devices.
### Installation
* Clone this repo into your plugins folder.
* Do not change the name. Leave it as `pico_slider`.
* Download [Swipe](https://github.com/bradbirdsall/Swipe) or some other slider lib.
* Setup the sliders JS and CSS files.
* Create a folder inside `content` called `images`. Path would be `{pico_root}/content/images/`.
* Inside that folder, drop all the images you want to use. (structure can be changed, defaut is `.jpg` images)
* Add the markup into your theme or mardown file
* Have fun!
### Markup
This is specific to [Swipe](https://github.com/bradbirdsall/Swipe). You can do whatever you like for your slider library.
```html
{% for image in images %}
{% endfor %}
```
### Image properties
Here is what is stored in each image item.
```php
$image = array(
'name' = 'mylittlepony', // basically just the file name without the extension
'width' = 900,
'height' = 600,
'url' = 'content/image/mylittlepony.jpg' // basically just the base_url + the image url
);
```
### Customizing Paths and Extensions
By default the plugin will only grab `.jpg` images. This can be changed in the `pico_slider.php` file.
```php
private $image_path = 'content/images'; // the path to the folder you want to use for loading the images
private $image_ext = '.jpg'; // the extension of the files you are looking for
```
### License
(The MIT License)
Copyright (c) <2013> James Doyle([@james2doyle](http://twitter.com/james2doyle)) james2doyle@gmail.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.