EvPartners
-----------

Simple plugin for having a Partners / Affiliates style section on a website.

Currently allows name / url / image for each Partner. Can also tag each partner to the slider.

The Partner Model has a function which can be used to retrieve all the partners tagged to a slider.


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

This is a composer plugin so from www/app just run composer as:-

    composer require evoluted/partners 2.1.* --prefer-source

To setup the database use the CakeDC Migrations plugin. To run the migrations and setup the database run:-

    Console/cake Migrations.migration run all --plugin EvPartners

Add the following to the plugin load array in 'app/Config/bootstrap.php':-

	'EvPartners' => array(
		'bootstrap' => true,
		'routes' => true
	)

You will want to add an item to the admin menu for managing partners:-

* /admin/ev_partners/partners/

To setup/override the plugin's default config create a new config file 'app/Config/Plugin/ev_partners.php'. The following options are available:-

* page_id - The page id to load for meta data use on the partners page.


Using EvPartners
------------------

A simple listing page is accessible via /partners
This page simply lists the active partners with the name / image and links them if they have an active url.

The template for this can be overwritten using the standard Cake plugin template overriding by creating a file at:

	app/View/Plugin/EvPartners/Partners/index.ctp

The plugin also comes with a function to retrieve all the partners tagged to the slider. This is useful for homepages / sidebars that show the sites partners.

In your controller where you want the partners to appear (i.e. getHomepageExtras or AppController::beforeRender()) place the following code to load the partners
and add to the template

		$Partner = ClassRegistry::init('EvPartners.Partner');
		$this->set(
			'sliderPartners',
			$Partner->getSliderPartners()
		);

Then in your template call the following element

		echo $this->Element(
			'EvPartners.slider-partners',
			array(
				'partners' => $sliderPartners
			)
		);

Again, this element can be overwritten using the standard Cake plugin template overriding:

	app/View/Plugin/EvPartners/Elements/slider-partners.ctp



Extending Plugin
----------------

The usual rules apply, don't edit the plugin directly but override it from within your own app.