PHPackages                             imagina/ibanners-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. imagina/ibanners-module

ActiveAsgard-module

imagina/ibanners-module
=======================

4.0.1(6y ago)01.4k7MITPHPPHP &gt;=7.0.0CI failing

Since Mar 14Pushed 9mo ago4 watchersCompare

[ Source](https://github.com/imagina/imaginacms-ibanners)[ Packagist](https://packagist.org/packages/imagina/ibanners-module)[ RSS](/packages/imagina-ibanners-module/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (17)Used By (0)

Ibanners Module
===============

[](#ibanners-module)

Special Thanks
--------------

[](#special-thanks)

to Nicolas Widart for AsgardCMS and his Menu Module, that was used as a foundation for the Banners Ads Module.

Installation
------------

[](#installation)

You can install Banners Ads module using composer: `composer require imagina/ibanners-module`

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

Usage
-----

[](#usage)

### Prerequisites

[](#prerequisites)

By default, Ibanners module is created using Bootstrap Carousel so make sure you have all prerequisites loaded for standard Bootstrap carousel (Bootstrap Carousel CSS and JS)

### Basic Usage

[](#basic-usage)

You can create basic Banners Ads 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.

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

### Advanced Usage

[](#advanced-usage)

#### Use your own slider template

[](#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. `{!! BannerAds::render('position_system_name', 'position/my-own-banner') !}}`

Template may look like this:

```
{-- Themes/MyTheme/views/banners/my-own-banner.blade.php --}

    @foreach($position->sbanner as $index => $banner)

    @endforeach

```

You will have `Modules\Ibanners\Entities\Position` instance available in the `$position` variable

#### Provide your own Position instance

[](#provide-your-own-position-instance)

You can also pass a `Modules\BannerAds\Entities\Position` instance as a first parameter instead of the slider `system_name` to render dynamically created slider.

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

```
