Download the PHP package experience/article without Composer

On this page you can find all versions of the php package experience/article. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package article

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

Article uses Smartdown to render your Markdown-formatted content. You must have version 3.0.1 or above installed and activated.

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.

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

There are three ways to use Article:

Service

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

Template service

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

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

Twig filter

Article exposes a single Twig filter, renderArticle.

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

Templates

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:

The supported template extensions are controlled by Craft's defaultTemplateExtensions config setting.

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:

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

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

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

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 to the wrapping tag:

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

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:

If you want to know more, Twig's documentation contains detailed information about whitespace control.


All versions of article with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.0.0
experience/smartdown Version ^3.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package experience/article contains the following files

Loading the files please wait ...