X-Ryl669 / grav-affiliate-links

An affiliate links plugin for Grav CMS
MIT License
2 stars 0 forks source link

Affiliate Link Plugin

The Affiliate Link Plugin for Grav CMS adds affiliation links to your pages

Demo

For example, it's being used on the bottom of this post on my blog.

Features

Installation

Admin Plugin

It is recommended to install Affiliate Link directly through the Admin Plugin by browsing to the Plugins tab and selecting Add.

Configuration

You can configure Affiliate Link via the Admin Plugin by browsing to Plugins and selecting Affiliate Links.

Usage

Global settings are configured at the plugin level as described above.

There is an additional configuration tab titled Affiliate Link available on each page in the page editor. This is where to set page specific information like enabling the affiliation, and entering links from providers.

Currently, only Amazon and AliExpress provider are supported, patch welcome for other providers.

Installation in your theme

In your theme's twig, you'll need to had the following code where you want the affiliate links to appear:

{% if config.plugins['affiliate-links'].enabled and page.header().affiliation|length %}
  {% include 'partials/affiliate-links.html.twig' %}
{% endif %}

Credits

Matt Mulhall for his Aura's plugin