Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Box

No security coverage Under active development 1 sites

This module allows you to embed reusable content "boxes" into your Drupal site using a simple text filter. You can reference these boxes by their ID or machine name, and specify how they should be displayed. This provides a lightweight alternative to blocks for embedding content.

This project allows you to embed a box entity which it provides into another entity using a text filter. Imagine you have a block-like content, which you would like to have embedded in content area of your site. You can just write:

[box:entity_id] or [box:entity_id:view_mode]

and this module will do all the magic, displaying box entity specified by entity ID in a given view mode (defaults to full) in a themeable box and current website language. If you prefer using machine names which (unlike entity IDs) describe box content better, just write:

[box-name:entity_machine_name] or [box-name:entity_machine_name:view_mode]

Box entity has been created for the sole purpose of embedment. It has bundles enabled and one default bundle (Default) created, has no view URL, is revisionable, comes with a node-like per-bundle permissions and carries no extra functionality like nodes (URL aliases, authoring information, ...) or blocks (placement, visibility settings, ...) which are of no use for the purpose of embedding. If user does not have appropriate permission for viewing embedded boxes (View published Box entities / View unpublished Box entities), nothing is displayed. View published Box entities is automatically enabled for both anonymous and authenticated users when module is installed.

Installation and usage:

  1. Install Box module
  2. Enable Insert boxes text filter for desired text formats
  3. (optional) Create new box bundles at Administration -> Structure -> Box types
  4. Create box entities at Administration -> Content -> Boxes
  5. (optional) Override box template to your liking
  6. Embed boxes using text filter:
    by entity ID: [box:entity_id] or [box:entity_id:view_mode]
    by entity machine name: [box-name:entity_machine_name] or [box-name:entity_machine_name:view_mode]

Why would you need a new module if blocks with their wonderful new custom block types seem to be ideally poised to accomplish this task?

You can indeed use Insert Block module and it may work just fine. However using blocks has three major drawbacks which might or might not affect you depending on your use case. For me they merited introduction of a separate module:

Ask your assistant about Box

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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
Jul 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
5.0.x-dev Dev 11 Jul 14, 2024