PHPackages                             tecnodesignc/adsense-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tecnodesignc/adsense-module

ActiveEncore-module[Utility &amp; Helpers](/categories/utility)

tecnodesignc/adsense-module
===========================

Adsense module for EncoreCMS

0.0.1(4y ago)03MITPHPPHP &gt;=7.1.0

Since May 31Pushed 4y agoCompare

[ Source](https://github.com/tecnodesignc/adsense-module)[ Packagist](https://packagist.org/packages/tecnodesignc/adsense-module)[ RSS](/packages/tecnodesignc-adsense-module/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Adsense Module
==============

[](#adsense-module)

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

[](#special-thanks)

to Nicolas Widart for EncoreCMS and his Menu Module, that was used as a foundation for the Adsense Module.

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

[](#installation)

You can install Adsense module using composer: `composer require tecnodesignc/adsense-module`

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

Usage
-----

[](#usage)

### Prerequisites

[](#prerequisites)

By default, Space 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 Space using the EncoreCMS admin interface - you can create and name your space (pay attention to the **System Name** field here, it is used later for rendering), and create individual ads. Ads 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 space is created, you can render it in your template using `{!! Space::render('space_system_name') !}}`

### Advanced Usage

[](#advanced-usage)

#### Use your own space template

[](#use-your-own-space-template)

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

Template may look like this:

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

    @foreach($space->ads as $index => $ad)

    @endforeach

```

You will have `Modules\Adsense\Entities\Space` instance available in the `$space` variable

#### Provide your own Space instance

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

You can also pass a `Modules\Adsense\Entities\Space` instance as a first parameter instead of the space `system_name` to render dynamically created space.

First, create instance of your space and add ads in your controller and pass it to the view

```
