Datablocks Integration Guide
  • Overview
    • Getting started
    • Integration methods
    • Contact information
    • Cache
  • Widgets exceptions
  • Integration
    • JS-Loader
    • Wordpress Plugin
    • Request - JSON
    • Request - HTML
    • IFrame
    • Vue.js
    • React
  • Styling
    • Tables
    • Graphs
Powered by GitBook
On this page
  • Description
  • Installation
  • Manual installation
  • Features
  • Create shortcodes
  • Option 1 - Copy the shortcode
  • Add to page
  • Optional class in a widget shortcode
  • Configuration

Was this helpful?

  1. Integration

Wordpress Plugin

PreviousJS-LoaderNextRequest - JSON

Last updated 15 days ago

Was this helpful?

Description

The MF Datablocks Wordpress Widget is a plugin which lets you add one (or multiple) Datablocks widgets to your Wordpress site. It enables an easy way to embed various types of Datablocks data from MFN for a particular company, onto different sections of your site.

For example you can add news-lists, stock-charts, subscribe and other widget types which are available in Datablocks.

Releases zip-files of the plugin can be found at

Installation

The simplest way to install the MF Datablocks Widget in Wordpress is to upload the plugin in the Wordpress Admin panel.

Start off by retrieving the WP plugin, from the link above.

Go to the Plugins section in the WP dashboard, click the button 'Add new' and then 'Upload plugin'.

Browse the plugin .zip-file and install. After installation, click 'Enable plugin'.

Manual installation

If you instead want to do a manual installation, you can download the plugin zip-file, unzip the package contents and then upload the db-wp-widget-folder to {Yourwordpressfolder}/wp-content/plugins/

Once installed the plugin is visible in the Plugins section where you can activate it. When you click 'activate', the Widget will be visible under Appearance -> Widgets as 'MF Datablocks WP Widget'.

Composer

Composer ()

$ composer require modfin/db-wp-plugin

Features

There are two ways in which the plugin enables you to add Datablocks data to your site:

  1. By Copying and pasting your own shortcode to your desired site section. For example the Footer.

  2. Or you can use the widget option, where you create the shortcode in appaerence -> widgets

The plugin widget loader allow multiple instances of Datablocks widgets placed on different sections on your site. So you can for example have a subscribe widget added to the Footer, and add a shortcode block for a stock-chart on the main page which will display simultaneously.

Create shortcodes

Option 1 - Copy the shortcode

Copy the below shortcode and add Widget type and Widget token/id from integration PDF, that Modular Fiance provides.

[mfdb_widget type='Widget type' token='Widget token' locale='sv']

Option 2 - Drag and drop Widget

To start using the Widget, go to Appearance -> Widgets and drag the widget over into a desired section of your page.

You will see the following options appear in the widget

To properly display the data on your site you need to fill in the required information:

Widget type - The name of your Datablocks widget, for example stock-chart

Widget token - Your widget token

Locale: - The language of the Datablocks widget content. This will be automatically inherited from the language used in Wordpress, if the field is left empty.

Classname - (Optional) Adds a class to the widget main div to enable individual CSS styling for each widget instance from the Customization section in Wordpress.

Demo - (For demo / test usage) Will generate random data if checked and is not recommended in production.

Add to page

  1. Add shortcode block:

  1. Paste shortcode with widget cridentials:

  1. Update page and you will see the widget:

Optional class in a widget shortcode

It is also possible add a unique classname to a shortcode widget instance by appending classname='{MyClassName}' to the shortcode like so:

[mfdb_widget type='Widget type' token='Widget token' locale='sv' classname='MyClassName']

This can be useful if you want to control CSS-styling for individual widgets.

Configuration

The MF Datablocks WP Widget adds a settings page in the WP dashboard where you can override the default Datablocks and JS Loader URL if needed. However, as the plugin already uses the correct URLs as default, there is normally no need to update these settings.

Code at

https://github.com/modfin/db-wp-plugin/releases
https://packagist.org/packages/modfin/db-wp-plugin
https://github.com/modfin/db-wp-plugin
How to add shortcode block
how to add shortcode
After adding shortcode