# Widgets

We recommend that the widgets below are short coded into a page.&#x20;

<div align="left"><img src="https://2300610606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEZKcUDr8JiG6uJAOqikZ%2Fuploads%2FT9zFNhwgD9zMNBdJEoHp%2Fwidgets.png?alt=media&#x26;token=97456930-6146-41e0-aa1e-a245336cfa82" alt=""></div>

Another way is to programmatically load in the widget shortcode in a post or page template ([https://developer.wordpress.org/reference/functions/do\_shortcode/](https://developer.wordpress.org/reference/functions/do_shortcode/)).

Even though it is possible to affect most configurations by sending in parameters directly in the shortcode of the widgets, other plugins such as [https://wordpress.org/plugins/amr-shortcode-any-widget/](https://wordpress.org/plugins/amr-shortcode-any-widget/) allowing for multiple instances and configurations, might be a helpful alternative when you have different pages for different languages.

{% hint style="info" %}
All widgets are left quite spars when it comes to styling so we recommend that you to style them yourself with CSS to fit your theme.
{% endhint %}

### MFN News feed

This widget creates a news room to display all the news. It can be configured only to show specific tags along the the title. You can also template the different sections.

#### Shortcode example

```
[mfn_news_feed_widget lang=all showthumbnail=true showfilter=true filtertags='regulatory,-regulatory' showyears=true yearstype=dropdown showpreview=true previewlen=150 pagelen=10 skipcustomtags=true groupbyyear=true showpagination=true onlytagsallowed=regulatory,regulatory-mar]
```

<table data-header-hidden><thead><tr><th width="374">Params</th><th>Values</th></tr></thead><tbody><tr><td><strong>Params</strong></td><td>Values</td></tr><tr><td><strong>lang</strong> The selected language of the news items, default is <code>"en"</code>set<code>"all"</code>to list releases of all languages or set<code>"auto"</code>to let the plugin try to figure out what lang is used</td><td><code>sv</code> or <code>en</code> or<code>fi, all or auto</code></td></tr><tr><td><strong>year</strong> Filter news list by a specific year</td><td><code>2020</code> eg.</td></tr><tr><td><strong>showyears</strong> Show the year filter section above the news list</td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>yearstype</strong> Filtering style for year</td><td><code>links</code> or <code>dropdown</code></td></tr><tr><td><strong>showfilter</strong> Show category filter section above the news list</td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>filtertype</strong> Filtering style for category</td><td><code>buttons</code> or <code>dropdown</code></td></tr><tr><td><strong>filtertags</strong> Customize the category filter tags (Comma separated) <em><strong>*Works only for filtertype=dropdown</strong></em><br><br><em><strong>For translations use</strong></em> filtertags=tag|lang|locale</td><td><code>'regulatory,-regulatory,report-interim,report-annual'</code> eg.<br><br>Translations<br><code>'regulatory|sv|Swedish translation|en|English translation'</code></td></tr><tr><td><strong>groupbyyear</strong> Group news items by year</td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>showpagination</strong> Show pagination, default <code>false</code></td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>showpreview</strong> Show preview excerpt of a news item, default <code>false</code></td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>pagelen</strong> Number of news items to show per page, default <code>20</code></td><td><code>10</code>eg.</td></tr><tr><td><strong>previewlen</strong> Amount of characters to show of the preview excerpt, shows a maximum of 250 characters</td><td><code>150</code>eg.</td></tr><tr><td><p><strong>tags</strong> Tags comma separated, to filter on.</p><p>You can also screen out just non-regulatory press </p><p>releases by entering:<code>-regulatory</code></p><p>or show items of a specific type with<code>type-pr</code> or <code>type-ir</code> . When multiple params releases that meet both tags will be filtered out</p></td><td><code>ci,regulatory</code>eg.</td></tr><tr><td><strong>orTags</strong> orTags comma separated, to filter on. When multiple params releases that meet either tag will be filtered out</td><td><code>type-ir,cus:news</code>eg.</td></tr><tr><td><strong>onlytagsallowed</strong> Tags comma separated, limits which tags to be shown in the news items list, if false no tags will be shown</td><td><code>mfn-regulatory,mfn-regulatory-mar, false</code></td></tr><tr><td><strong>skipcustomtags</strong> Will prevent showing custom tags in the news list,  default <code>false</code></td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>timestampformat</strong> Set the timestamp format of the publish date, default <code>'Y-m-d H:i'</code></td><td><code>'d M, Y H:i'</code> eg.</td></tr><tr><td><strong>tzlocation</strong> Set the timezone location for the publish date, default <code>'Europe/Stockholm'</code>(<a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a>)</td><td><code>'Europe/Tallinn'</code> eg.</td></tr><tr><td><strong>disclaimertag</strong> Used to trigger a redirect to a 'disclaimer wall' URL (when clicking the title of the release in the list) if the release includes the specific tag</td><td>eg. mfn-cus-disclaimer</td></tr><tr><td><strong>disclaimerurl</strong> The URL to redirect to which has the disclaimer wall (usually the relative url of an IPO-page)</td><td>eg /ipo</td></tr><tr><td><strong>showthumbnail</strong> Displays a thumbnail below the title (of the featured image)</td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>thumbnailsize</strong> Override the default size of the thumbnail, default is <code>full_size</code></td><td><code>thumbnail</code> or <code>medium</code> or<code>medium_large</code> or <code>large</code> or <code>full_size</code></td></tr><tr><td><strong>shownotfound</strong> Will display a "Not Found" message when filtering yields no results</td><td><code>true</code> or <code>false</code> or <code>1</code> or <code>0</code></td></tr><tr><td><strong>fromyear</strong> Set "from year" for the desired period</td><td>2017 eg. </td></tr><tr><td><strong>fromdate</strong> Sets start-date on feed</td><td>fromdate='2017-08-18'</td></tr><tr><td><strong>todate</strong> Sets end-date on feed</td><td>todate='2022-01-01'</td></tr><tr><td><strong>forcelocale</strong> Forces the language of the news feed to be in the set language, independent of the language in wordpress</td><td><code>sv</code> or <code>en</code></td></tr></tbody></table>

### Custom templates

If you would like to customize the HTML or add a specific class to the news item you can use the `template` parameter to ad your custom HTML template into the shortcode:

#### Custom news item template example

```
[mfn_news_feed_widget template='<div class="mfn-item"><div class="mfn-title"><a href="{{url}}">{{title}}</a></div><div class="mfn-date">{{date}}</div><div class="mfn-tags">{{tags}}</div><div class="mfn-preview">{{preview}}</div><span><a href="{{url}}">Read More <i class="icon-button-arrow"></i></a></span></div>']
```

The same is possible for the tag list or year list:

#### Custom tag template example

```
[mfn_news_feed_widget tagtemplate='<span class="mfn-tag mfn-tag-{{slug}}">{{tag}}</span>']
```

#### Custom year template example

```
[mfn_news_feed_widget yeartemplate='<span class="mfn-year-header mfn-year mfn-year-header-{{year}}"><a href="{{url}}" class="mfn-year-header-link mfn-year-header-link-{{year}}">{{year}}</a></span>']
```

#### Custom thumbnail template example

```
[mfn_news_feed_widget showpreview=true showthumbnail=true template='<div class="mfn-item">{{thumbnail}}<div class="mfn-title"><a href="{{url}}">{{title}}</a></div><div class="mfn-date">{{date}}</div><div class="mfn-tags">{{tags}}</div><div class="mfn-preview">{{preview}}</div><span><a href="{{url}}">Read More <i class="icon-button-arrow"></i></a></span></div>']
```

### MFN Report Archive

**MFN Report Archive V2**

In our plugin release **v0.0.58**, we've added a new Report Archive V2 widget which uses our new Report Archive API.

Our new API makes it possible for us to deliver a more extensive archive which supports different types of media (except for just the PDF), for example video, audio, webcast-link etc. The main difference is that the widget loads in the report archive externally. We set up the archive template and settings initially in our backend (per project) and then deliver a widget id.

**Shortcode example**

```
[mfn_archive_v2_widget widget_id='your-archive-widget-id-here' lang=sv]
```

{% hint style="info" %}
The `widget_id` is a specific ID for a widget that is externally maintained by MFN. It will be provided to you by your MFN technical contact.
{% endhint %}

<table data-header-hidden><thead><tr><th width="365.1428571428571">Params</th><th>Values</th></tr></thead><tbody><tr><td><strong>Params</strong></td><td>Values</td></tr><tr><td><strong>widget_id</strong> The widget id / token</td><td>{Provided by MFN)</td></tr><tr><td><strong>lang</strong> The language of the reports to be listed. Default is <code>"en,"</code></td><td><code>sv</code> or <code>en</code> or<code>fi</code></td></tr><tr><td></td><td></td></tr></tbody></table>

#### **MFN Report Archive&#x20;**<mark style="color:red;">**(Deprecated)**</mark>&#x20;

#### <mark style="color:red;">**Do not use unless your wordpress plugin is version 0.0.57 or prior.**</mark>

This widget creates an archive for financial reports. It is configurable and supports fiscal year offset, generic titles (eg. _Interim Q1 2019_) as well as displaying a thumbnails of the reports in the archive.

**Shortcode example**

```
[mfn_archive_widget showfilter=true showthumbnail=true showyear=true]
```

| **Params**                                                                                                               | Values                            |
| ------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |
| **showfilter** Show the filter section, default: `false`                                                                 | `true` or `false` or `1` or `0`   |
| **showdate** Show the date, default: `false`                                                                             | `true` or `false` or `1` or `0`   |
| **showyear** Show the year, default: `false`                                                                             | `true` or `false` or `1` or `0`   |
| **fromyear** Set "from year" for the desired period                                                                      |  `2017` .eg                       |
| **toyear** Set "to year" for the desired period                                                                          |  `2021` .eg                       |
| **showheading** Show the heading, default `false`                                                                        | `true` or `false` or `1` or `0`   |
| **showthumbnail** Show report thumbnail image, default `false`                                                           | `true` or `false` or `1` or `0`   |
| **showgenerictitle** Show a generic title (Instead of the title of the report), default `false`                          | `true` or `false` or `1` or `0`   |
| **usefiscalyear** Enable fiscal year period support, default `true`                                                      | `true` or `false` or `1` or `0`   |
| **usefiscalyearoffset** Offset for the fiscal year period                                                                | `1` .eg                           |
| **useproxiedattachments** Use cached attachments for thumbnails if available, default `true`                             | `true` or `false` or `1` or `0`   |
| **lang** Set the language of the reports, default `"en"`set`"auto"`to let the plugin try to figure out what lang is used | `sv` or `en` or`fi or auto`       |
| **limit**  Limit number of reports to show, default `500`                                                                | `20` .eg                          |
| **offset** Drop X number of items from start of the list                                                                 | `1` eg. (skips the latest report) |



### MFN Subscription Widget

The subscription widget enables users to easily add a subscription form that makes it possible for visitors of the website to sign up, to receive emails with the latest press releases.

**Shortcode example**

```
[mfn_subscription_widget widget_id='your-subscription-widget-id-here']
```

{% hint style="info" %}
The`widget_id` is a specific ID for a widget that is externally maintained by MFN. It will be provided to you by your MFN technical contact.
{% endhint %}

<table data-header-hidden><thead><tr><th width="365.1428571428571">Params</th><th>Values</th></tr></thead><tbody><tr><td><strong>Params</strong></td><td>Values</td></tr><tr><td><strong>widget_id</strong> The widget id / token</td><td>{Provided by MFN)</td></tr><tr><td><strong>lang</strong> The language of the subscription widget. Default is <code>"en" and "auto" lets the plugin figure out what language is used</code></td><td><code>sv</code> or <code>en</code> or<code>fi or auto</code></td></tr></tbody></table>
