Posted by tnichols on October 6, 2010 at 4:33am
I've been using the Wordpress_import module, and found an annoyance was the lack of support for the [wpcaption] tag.
It seemed like something that may be useful outside of the Wordpress_import as well, so I put together a simple module to implement the tag as an input filter.
It's working well for me, and I'm considering sharing it as a contributed module. I haven't found another module that does the complete implementation, as follows:
/**
* @file
* A module that allows users to enter [caption ...]info[/caption] tags into
* text in Drupal. This will be translated to a caption and some style
* formatting that can be wrapped around any element (but typically an image)
*
* The supported attributes for the shortcode are 'id', 'align', 'width', and
* 'caption'.
*
* captions can wrap any type of html element, and should look as follows:
*
* [caption id="someid" align="alignright|alignleft" width="###"
* caption="any text caption"]
* <html to be wrapped in the caption>
* [/caption]
*
* This will produce the following HTML (Note that we add 10px to ### for buffer
* and to match the style produced from the Wordpress shortcode that we're
* mimicing
*
* <div id="someid" class="wp-caption wp-alignright|wp-alignleft" style="width: ###+10px;">
* <html to be wrapped>
* <p class="wp-caption-text">any text caption</p>
* </div>
*
* Note that all of the caption attributes are optional
*
* The related CSS is contained in an external CSS file
* @link css/wpcaption_filter.css
*/Does anyone have any comments or suggestions?
Thanks!
Tim
Comments
Where is the module's code
Where is the module's code available?
Bevan/