Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

The CSS 3 column-count attribute creates documents (or parts of documents) with multiple columns. See http://www.quirksmode.org/css/multicolumn.html for examples. Not all browsers support this attribute, and those that do implement it inconsistently.

This filter imitates the effect of the column-count attribute just for lists. It provides consistency and a simple input format: simply put each list item on a separate line. For example, it will format

<multicolumn cols="3" type="ol">
one
two
three
four
five
six
seven
</multicolumn>

into something like this:

  1. one
  2. two
  3. three
  1. four
  2. five
  1. six
  2. seven

(depending on how you style <ol>).

The cols and type attributes can be given in either order. The first should be a positive integer and defaults to 1; the second should be one of 'ul', 'ol', or 'plain', and defaults to 'ul'. If type is set to 'plain', then the lists will be formatted as unordered lists with list-style: none;. Any additional attributes are passed to theme('multicolumn_list') (see below) as key-value pairs in the array $variables['attributes'].

List items are created based on line breaks in the input text. Do not insert <li> tags.

If you use the HTML filter after this one, make sure that it allows the tags that this filter produces. It is all right to use the HTML filter before this one, since a "prepare" function replaces <multicolumn> with [multicolumn] before the HTML filter is run. If you use the Line Break filter, do not use it before this one: it changes line breaks, which this filter uses to separate list items.

Theming

Drupal 8

The module uses three Twig templates:

multicolumn-list.html.twig
Format one column.
multicolumn-row.html.twig
Arrange columns side by side.
multicolumn-comment.html.twig
Wrap text in HTML comment markers.

You can override these by copying the templates to your theme and modifying them to suit your needs.

The default template multicolumn-list.html.twig adds in-line CSS styles. If you override the template, and you know in advance how many columns you will be using, then you may prefer to add the CSS through your theme.

Render elements are passed to multicolumn-row.html.twig, not strings, so it is easy for your version of this function to make changes before final rendering.

If you do not care to add <!-- multicolumn start --> and <!-- multicolumn end --> to your pages, simply have your version of multicolumn-comment.html.twig generate an empty string.

Drupal 7

The module defines three theme functions:

theme_multicolumn_list($variables)
Format one column.
theme_multicolumn_row($variables)
Arrange columns side by side.
theme_multicolumn_comment($variables)
Wrap text in HTML comment markers.

You can override these by defining functions MYTHEME_multicolumn_list(), MYTHEME_multicolumn_row(), and MYTHEME_multicolumn_comment() (replacing MYTHEME with the name of your theme) in your theme's template.php file.

The default implementation of theme_multicolumn_list() adds in-line CSS styles. If you write your own theme functions, and you know in advance how many columns you will be using, then you may prefer to add the CSS through your theme.

Render elements are passed to theme_multicolumn_row(), not strings, so it is easy for your version of this function to make changes before final rendering.

If you do not care to add <!-- multicolumn start --> and <!-- multicolumn end --> to your pages, simply have your version of theme_multicolumn_comment() return an empty string.

TODO

  • I could add support for definition lists if anyone wants such a feature.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Mar 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.2 Stable Mar 25, 2023