All Projects → artifex404 → grav-plugin-instagram

artifex404 / grav-plugin-instagram

Licence: MIT license
Instagram is a simple plugin that includes Instagram feed to your Grav website.

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to grav-plugin-instagram

grav-plugin-langswitcher
Grav LangSwitcher Plugin
Stars: ✭ 22 (+69.23%)
Mutual labels:  grav, grav-plugin
grav-plugin-advanced-pagecache
Grav AdvancedPageCache Plugin
Stars: ✭ 19 (+46.15%)
Mutual labels:  grav, grav-plugin
grav-plugin-devtools
Grav Devtools Plugin
Stars: ✭ 36 (+176.92%)
Mutual labels:  grav, grav-plugin
grav-plugin-featherlight
Grav Featherlight Plugin
Stars: ✭ 29 (+123.08%)
Mutual labels:  grav, grav-plugin
grav-plugin-mathjax
This plugin allows you to include math formulas in your web pages, either using TeX and LaTeX notation, and/or as MathML.
Stars: ✭ 18 (+38.46%)
Mutual labels:  grav, grav-plugin
grav-plugin-themer
This plugin enables you use different themes on one site individual set per page or collection.
Stars: ✭ 16 (+23.08%)
Mutual labels:  grav, grav-plugin
grav-plugin-maintenance
Grav Maintenance Plugin
Stars: ✭ 12 (-7.69%)
Mutual labels:  grav, grav-plugin
grav-plugin-blackhole
The static site generator for Grav CMS
Stars: ✭ 152 (+1069.23%)
Mutual labels:  grav, grav-plugin
grav-plugin-comments
Grav Comments Plugin
Stars: ✭ 52 (+300%)
Mutual labels:  grav, grav-plugin
grav-plugin-simplesearch
Grav SimpleSearch Plugin
Stars: ✭ 40 (+207.69%)
Mutual labels:  grav, grav-plugin
grav-plugin-toc
This plugin automagically generates a (minified) Table of Contents based on special markers in the document and adds it into the resulting HTML document.
Stars: ✭ 12 (-7.69%)
Mutual labels:  grav, grav-plugin
grav-plugin-api
A REST API plugin for GravCMS
Stars: ✭ 24 (+84.62%)
Mutual labels:  grav, grav-plugin
grav-plugin-markdown-notices
Grav Markdown Notices Plugin
Stars: ✭ 31 (+138.46%)
Mutual labels:  grav, grav-plugin
grav-plugin-snipcart
Grav Snipcart Plugin
Stars: ✭ 17 (+30.77%)
Mutual labels:  grav, grav-plugin
grav-plugin-form
Grav Form Plugin
Stars: ✭ 48 (+269.23%)
Mutual labels:  grav, grav-plugin
grav-plugin-external-links
This plugin adds small icons to external and mailto links, informing users the link will take them to a new site or open their email client.
Stars: ✭ 15 (+15.38%)
Mutual labels:  grav, grav-plugin
grav-plugin-shortcode-core
Grav Shortcode Core Plugin
Stars: ✭ 42 (+223.08%)
Mutual labels:  grav, grav-plugin
grav-plugin-proposal
Sales Proposal Plugin for Grav
Stars: ✭ 16 (+23.08%)
Mutual labels:  grav, grav-plugin
grav-plugin-jscomments
JSComments is a Grav (http://github.com/getgrav/grav) plugin which allows to integrate comments into individual pages from Discourse / Disqus / Facebook / Google+ / HyperComments / IntenseDebate / Isso, and Muut comment systems.
Stars: ✭ 28 (+115.38%)
Mutual labels:  grav, grav-plugin
grav-plugin-data-manager
Grav Data Manager Plugin
Stars: ✭ 28 (+115.38%)
Mutual labels:  grav, grav-plugin

Grav Instagram Plugin

Instagram is a simple Grav Plugin that includes your Instagram feed to your Grav website.

Installation

Installing the Instagram plugin can be done in one of two ways. Using GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.

GPM Installation (Preferred)

The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's Terminal (also called the command line). From the root of your Grav install type:

bin/gpm install instagram

This will install the Instagram plugin into your /user/plugins directory within Grav. Its files can be found under /your/site/grav/user/plugins/instagram.

Manual Installation

To install this plugin, just download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to instagram. You can find these files either on GitHub or via GetGrav.org.

You should now have all the plugin files under

/your/site/grav/user/plugins/instagram

Configuration

You need to provide few configurations in order for the feed show up. In your Grav Administration panel, go to Plugins > Instagram to view the plugin configuration page.

Enter the Instagram user_id whose feed you want to show, and your Instagram API access_token.

Note, that your access token needs to have the public_content scope authorized.

For more information how to get user_id or access_token, see the Instagram API documentation.

Customization

To customize how the your feed looks like, you might want to customize the generated markup. To do that, copy the template file instagram.html.twig to your templates/partials folder of your theme. For example:

/your/site/grav/user/themes/custom-theme/templates/partials/instagram.html.twig

It will now override the default markup of the feed. You can tweak it however you like.

Config Defaults

If you need to override some plugin default values, the best practise is to copy the instagram.yaml file into your users/config/plugins/ folder (create it if it doesn't exist), and then modify there. This will override the default settings.

Usage

To use this plugin you simply need to include a function your template file such as:

{{ instagram_feed() }}

This will be converted into your Instagram feed as follows:

<ul>
    <li><a href="{{ post.link }}" target="_blank"><img src="{{ post.image }}" alt=""></a></li>
    <li><a href="{{ post.link }}" target="_blank"><img src="{{ post.image }}" alt=""></a></li>
    ...
</ul>

You can also pass in twig variables, such as a custom class.

{{ instagram_feed({custom_class: 'someclass'}) }}

This will be accessible in the partials/instagram.html.twig as a property of a params variable. For example:

{% for post in feed|slice(0, count)  %}
    <li class="{{ params.custom_class }}"><a href="{{ post.link }}" target="_blank"><img src="{{ post.image }}" alt=""></a></li>
{% endfor %}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].