Provides integration with ipstack service and Drupal blocks.

Adds new ipstack block condition that controls block visibility depending on the location criteria specified for the block.

User's IP address is used to determine location and to determine if block should be shown or not.

Requirements

Requires IPstack API key and account. Visit the following page for more information or to signup for an account: https://ipstack.com/product

Requires the IPstack module for API layer and storing API key. See for information: https://www.drupal.org/project/ipstack

Requires Drupal blocks in core.

Install

Install via composer. See below:

composer require drupal/block_ip_stack
drush en block_ip_stack

General Configuration

Configure IPstack API key and any other additional configuration here:
/admin/config/system/ipstack

Block Configuration

  1. Go to "Block Layout" page: /admin/structure/block
  2. Select or create new block.
  3. Under "Visibility", a new vertical tab called "IPstack" should be present.
  4. Select tab and configure conditions as needed.
  5. If any of the conditions are true or match up, block will be made visible or not.

Roadmap

Ability to configure blocks without visibility condition. Essentially controlling block display via JS instead of using condition plugin.

Supporting organizations: 

Project information

Releases