Module allows export arbitrary block as an HTML widget that could be embedded to a 3-rd party site.
Module implements custom lightweight and fast function to output HTML page, so full Drupal page output process is not used.
Export widget contains only HTML of the block. If block requires CSS or Javascript - they should be handled separately (for example by theming).
Using
Widget could be embedded directly on the other site page using iframe (easiest option) or by making cURL request and then outputting on other site.
For each block export could be enabled/disabled and export format could be configured.
Following export formats are supported:
- Default block widget: contains fully rendered block including all div wrappers;
- Default block widget without title: the same as above but without block title;
- Simple block content only: for user-created blocks is possible to export only content (block body) without any wrappers;
- Simple box content only: the same as above but for blocks created with Boxes module;
Other modules could create custom export formats and handle them in a different way.
Theming
If you export block using format Default block widget or Default block widget without title then it is possible to theme block as usual. Block will have a specific region called 'block_export_widget' assigned to it.
Theming also can be used to add custom javascript or css.
Troubleshooting
You should assume that request from the 3rd party site will be handled as
request from anonymous user, so exported widget will contain content that is
accessible for anonymous users only.
If requested block doesn't exist or export is not enabled for it,
then 404 error will be returned.
If site is in maintenance mode, then 403 error is returned.
Both for 404 and 403 errors empty content is returned.
Plans for future releases
- To add block's css and/or javascript to the export output.
- Configure cache settings for each exported block (issue)
Project information
- Project categories: Content editing experience, Content display, Developer tools
8 sites report using this module
- Created by Eugene Fidelin on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.

