PHPackages                             experience/article - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. experience/article

AbandonedArchivedCraft-plugin[Parsing &amp; Serialization](/categories/parsing)

experience/article
==================

Article eases the pain of rendering Matrix and Markdown-powered content.

2.0.1(7y ago)54MITPHP

Since Aug 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/manifestuk/article.craft-plugin)[ Packagist](https://packagist.org/packages/experience/article)[ RSS](/packages/experience-article/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Article Craft Plugin
====================

[](#article-craft-plugin)

Article solves a very specific problem: parsing Markdown-formatted content in Matrix fields. In particular, Markdown-formatted content which contains footnotes.

You may be wondering why that requires a plugin.

The truth is, it doesn't. You can achieve the same end result through a careful combination of Twig macros, includes, shouting, and despair. Article is just easier.

Requirements
------------

[](#requirements)

Article uses [Smartdown](https://github.com/experience/smartdown.craft-plugin "Bringing the unbridled joy of Markdown Extra and Smartypants to your Craft websites.") to render your Markdown-formatted content. You must have version 3.0.1 or above installed and activated.

Installation
------------

[](#installation)

Article is not available via the Craft Plugin Store, and probably never will be. If, by some miracle, you think Article would be of use in your Craft project, you can install it using Composer.

```
$ cd /path/to/site
$ composer require experience/article

```

Configuration
-------------

[](#configuration)

Article makes no assumptions regarding the structure of your Matrix field, or the templates used to render the content.

You just need to tell Article where to find your templates, by configuring the "templates path" on the plugin's settings page.

Usage
-----

[](#usage)

There are three ways to use Article:

- As a Craft service
- As a Craft template service (or [whatever template variables are now called](https://docs.craftcms.com/v3/extend/updating-plugins.html#template-variables))
- As a Twig filter

### Service

[](#service)

The Article service exposes a single method, `render`. The method accepts a Matrix field, and returns the parsed content.

```
use experience\article\Article;

$content = Article::getInstance()->article->render($entry->matrixField);

```

### Template service

[](#template-service)

The Article template service exposes the same `render` method as the main service.

```
{{ craft.article.render(entry.matrixField)|raw }}

```

Note the you *must* use the `raw` filter, otherwise Twig will auto-escape any HTML tags.

### Twig filter

[](#twig-filter)

Article exposes a single Twig filter, `renderArticle`.

```
{{ entry.matrixField|renderArticle|raw }}

```

As with the template service, don't forget to use the `raw` filter.

Templates
---------

[](#templates)

### Overview

[](#overview)

When it comes time to parse your Matrix field, Article uses the templates in your templates directory to render the content of each Matrix block.

In short, Article looks for a file with the same name as the `handle` of the Matrix block.

For example, let's say your templates directory is `articles/_blocks`, and your Matrix block has a `handle` of "text".

In this case, Article will look for the following templates. If one of them exists, it will use it to render the Matrix block:

- `articles/_blocks/text.html`
- `articles/_blocks/text.twig`

The supported template extensions are controlled by [Craft's `defaultTemplateExtensions` config setting](https://docs.craftcms.com/v3/config/config-settings.html#defaulttemplateextensions).

### The `block` template variable

[](#the-block-template-variable)

Each template has access to a single variable, `block`, which is the `MatrixBlock` model for the current block. For example, if your `text` block type contains a `body` field, you can access it as follows:

```
{{ block.body }}

```

Tips and tricks
---------------

[](#tips-and-tricks)

Article isn't a mind-reader, and it doesn't make any assumptions regarding the content of your templates.

This section includes a few tips and tricks, which should make it a little easier to author Article-friendly templates.

### Use the `raw` filter

[](#use-the-raw-filter)

Apply the `raw` filter to Markdown-formatted content, as follows:

```
{{ block.markdownField|raw }}

```

If you don't Twig will try its utmost to convert your carefully crafted Markdown into HTML entities, resulting in non-parsed Markdown links, quotes, and so forth.

Applying the `raw` filter is a simple fix, which will save you countless headaches.

### Tell Article if you have Markdown inside HTML

[](#tell-article-if-you-have-markdown-inside-html)

If you wrap your Markdown-formatted content with HTML tags, you'll need to let Article (or, more precisely, PHP Markdown Extra) know.

You do this by adding [the `markdown="1"` attribute](https://michelf.ca/projects/php-markdown/extra/#markdown-attr) to the wrapping tag:

```

This text is _italic_, and wrapped in paragraph tags.

```

PHP Markdown Extra automatically removes the `markdown="1"` attribute, ensuring your HTML remains nice and clean.

### Eliminate whitespace

[](#eliminate-whitespace)

Markdown is *very* whitespace-sensitive. If you suddenly find your content riddled with unwanted code blocks, it's very likely that leading whitespace is the culprit.

Here's how to solve that:

```

    {{- block.markdownField -}}

```

If you want to know more, Twig's documentation contains [detailed information about whitespace control](http://twig.sensiolabs.org/doc/1.x/templates.html#templates-whitespace-control).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

2816d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/439058?v=4)[Andrei Nesterov](/maintainers/manifest)[@manifest](https://github.com/manifest)

---

Top Contributors

[![monooso](https://avatars.githubusercontent.com/u/4369838?v=4)](https://github.com/monooso "monooso (1 commits)")

---

Tags

craftcraft-plugincraftcmscraftcms-pluginmarkdowncmsCraftcraftcmscraft-plugintypography

### Embed Badge

![Health badge](/badges/experience-article/health.svg)

```
[![Health](https://phpackages.com/badges/experience-article/health.svg)](https://phpackages.com/packages/experience-article)
```

###  Alternatives

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[hut6/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

102.3k](/packages/hut6-oembed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
