Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Commit

Permalink
add option to override the imageCount value
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabea David committed Nov 9, 2017
1 parent 00d3c56 commit b1474a0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,15 @@
## 1.0.2 (2017-11-09)

[view at Github](https://github.com/justonestep/processwire-instagramfeed/releases/tag/1.0.2)

- add a way of setting the imageCount value when initialising the module

## 1.0.1 (2016-10-06)

[view at Github](https://github.com/justonestep/processwire-instagramfeed/releases/tag/1.0.1)

- add ProcessWire 3.x compatibility / namespaces

## 1.0.0 (2016-06-03)

[view at Github](https://github.com/justonestep/processwire-instagramfeed/releases/tag/1.0.0)
Expand Down
15 changes: 13 additions & 2 deletions InstagramFeed.module
Expand Up @@ -10,7 +10,7 @@
*
*
* @author Tabea David <info@justonestep.de>
* @version 1.0.1
* @version 1.0.2
* @copyright Copyright (c) 2016 justonestep.de, <info@justonestep.de>
* @see https://github.com/justonestep/processwire-instagramfeed
* @see http://www.processwire.com
Expand Down Expand Up @@ -41,7 +41,7 @@ class InstagramFeed extends WireData implements Module, ConfigurableModule {
return array(
'title' => 'Instagram Feed',
'summary' => 'Represents an instagram feed',
'version' => 101,
'version' => 102,
'href' => 'https://github.com/justonestep/processwire-instagramfeed ',
'singular' => true,
'autoload' => true,
Expand Down Expand Up @@ -392,6 +392,17 @@ EOD;
return isset($link) ? $link : '';
}

/*
* Set Image Count
*
* @param integer $param
* @return $this
*/
public function setImageCount($imageCount = 4) {
$this->imageCount = (int)$imageCount;
return $this;
}

/*
* Get current URI
*
Expand Down
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -142,6 +142,17 @@ $feed = $modules->get('InstagramFeed')->getRecentMedia(); ?>
</div>
```

### Override the imageCount value

- setImageCount($int)

This is a way of setting the `imageCount` value when initialising the module.
It might come in handy if ever you want to show different number of images on different pages.

```php
<?php $feed = $modules->get('InstagramFeed')->setImageCount(2)->getRecentMedia(); ?>
```

**Links:**

* [oauth authentication](http://codular.com/oauth-authentication-with-instagram)
Expand Down

0 comments on commit b1474a0

Please sign in to comment.