2017 © Pedro Peláez
 

asgard-module slider-module

Slider module for AsgardCMS

image

arturmamedov/slider-module

Slider module for AsgardCMS

  • Tuesday, August 8, 2017
  • by arturmamedov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 26 Versions
  • 0 % Grown

The README.md

Slider Module

Special Thanks

to Nicolas Widart for AsgardCMS and his Menu Module, that was used as a foundation for the Slider Module., (*1)

Installation

You can install Slider module using composer: composer require bociancz/slider-module, (*2)

After the module is installed, you have to give yourself access in AsgardCMS (using Roles/Permissions). New Slider item will appear in the Sidebar, (*3)

Usage

Prerequisites

By default, Slider module is created using Bootstrap Carousel http://getbootstrap.com/javascript/#carousel so make sure you have all prerequisites loaded for standard Bootstrap carousel (Bootstrap Carousel CSS and JS), (*4)

Basic Usage

You can create basic Slider using the AsgardCMS admin interface - you can create and name your slider (pay attention to the System Name field here, it is used later for rendering), and create individual slides. Slides can be linked to images in the Media module, or have URL pointing to external image. They can also contain hyperlink to any page on the site, fixed URI or URL., (*5)

When the slider is created, you can render it in your template using {!! Slider::render('slider_system_name') !}}, (*6)

Advanced Usage

Use your own slider template

If you want to change rendering of your slider, use custom HTML, CSS classes, etc, you can pass a Blade template name as a second parameter to the render() method, i.e. {!! Slider::render('slider_system_name', 'slider/my-own-slider') !}}, (*7)

Template may look like this:, (*8)

{-- Themes/MyTheme/views/slider/my-own-slider.blade.php --}


@foreach($slider->slides as $index => $slide) @endforeach

You will have Modules\Slider\Entities\Slider instance available in the $slider variable, (*9)

Provide your own Slider instance

You can also pass a Modules\Slider\Entities\Slider instance as a first parameter instead of the slider system_name to render dynamically created slider., (*10)

First, create instance of your slider and add slides in your controller and pass it to the view, (*11)

<?php
...
// import classes needed to create your own instance
use Modules\Slider\Entities\Slider;
use Modules\Slider\Entities\Slide;

class HomepageController {
    ...
    /**
     * controller method
     */
    public function displayHomepage()
    {
        // make a new Slider instance
        $mySlider = new Slider;
        $mySlider ->system_name = 'custom_slider';

        // create slide 1
        $slide1 = new Slide;
        $slide1->title = 'First Slide';
        $slide1->caption = 'First slide text';
        $slide1->external_image_url = 'https://placeholdit.imgix.net/~text?txtsize=33&txt=Slide1&w=800&h=300';

        // create slide 2
        $slide2 = new Slide;
        $slide2->title = 'Second Slide';
        $slide2->caption = 'Second slide text';
        $slide2->external_image_url = 'https://placeholdit.imgix.net/~text?txtsize=33&txt=Slide2&w=800&h=300';

        // add slides to slider
        $mySlider->slides->add($slide1);
        $mySlider->slides->add($slide2);

        // render view
        return View::make('homepage')
            ->with('mySlider', $mySlider);
    }

then, inside of the homepage.blade.php template, you can render slider using {!! Slider::render($mySlider) !!}, (*12)

Resources

The Versions

08/08 2017

dev-bugfix/SidebarDuplicatedWeight

dev-bugfix/SidebarDuplicatedWeight

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

07/08 2017

dev-master

9999999-dev

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

19/05 2017

dev-bugfix/2.0/slideActive

dev-bugfix/2.0/slideActive

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

19/05 2017

dev-bugfix/slideActive

dev-bugfix/slideActive

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

19/05 2017

dev-feauture/2.0/uploadOnCreate

dev-feauture/2.0/uploadOnCreate

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

19/05 2017

dev-withTenant

dev-withTenant

Slider module for AsgardCMS, forked from bociancz/slider-module, with Tenant id for separate sliders of each user and other little improvment, require changes Core of Asgard CMS!

  Sources   Download

MIT

The Requires

 

by Artur Mamedov

slider asgardcms multitenant

19/05 2017

dev-bugfix/apiRoutes

dev-bugfix/apiRoutes

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

16/05 2017

dev-bugfix/2.0/componentsNames

dev-bugfix/2.0/componentsNames

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

16/05 2017

dev-bugfix/componentsNames

dev-bugfix/componentsNames

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

16/05 2017

0.4.6

0.4.6.0

Slider module for AsgardCMS, forked from bociancz/slider-module, with Tenant id for separate sliders of each user and other little improvment, require changes Core of Asgard CMS!

  Sources   Download

MIT

The Requires

 

by Artur Mamedov

slider asgardcms multitenant

11/05 2017

2.0.x-dev

2.0.9999999.9999999-dev

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

30/11 2016

dev-feature/cs-translation

dev-feature/cs-translation

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

06/11 2016

0.4.5

0.4.5.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

06/11 2016

dev-bugfix/nonexisting-slider-render-fix

dev-bugfix/nonexisting-slider-render-fix

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

04/11 2016

0.4.4

0.4.4.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

04/11 2016

dev-feature/no-controls-for-single-slide

dev-feature/no-controls-for-single-slide

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

23/10 2016

0.4.3

0.4.3.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

23/10 2016

dev-bugfix/allActive

dev-bugfix/allActive

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

22/10 2016

0.4.2

0.4.2.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

22/10 2016

0.4.1

0.4.1.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

22/10 2016

0.4.0

0.4.0.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

21/10 2016

0.3.0

0.3.0.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

18/10 2016

0.2.0

0.2.0.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

10/10 2016

0.1.2

0.1.2.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

10/10 2016

0.1.1

0.1.1.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms

10/10 2016

0.1

0.1.0.0

Slider module for AsgardCMS

  Sources   Download

MIT

The Requires

 

by David Cap

slider asgardcms