Content last modified Monday 15 March 2010
hop to #bottom
Categories:
Author:
Current version:
0.3
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

yab_image

Yes, another image plugin for textpattern. :)

The problem

Because this is a little bit small have a look at the plugin site. It will show you some examples of the problem.

What it does

This plugin allows you to display an image with an assigned caption as caption :). The width of the caption will always fits the width of the displayed image.

Usage

You can use this plugin almost the same as <txp:image />. The behavior is a little bit different: If a caption for an image is available and if you want to float the image and the caption, use the align attribute. This will float the image and the caption.

If no image caption is given <txp:yab_image /> works the same as <txp_image />ยท

F.i.: <txp:yab_image id="5" align="right" />

Additional an alt_caption attribute is available. So you can overwrite an existent caption and display an image with different captions. If you html-escape the captions, use escape="html" as same is as in <txp:image />.

F.i.: <txp:yab_image id="5" align="right" alt_caption="This is a alternative caption" />

Styling

The plugin will create new html elements:

If an image caption is given:
<small class="caption">given caption here</small>: This elements will wrap the caption.

And if additionally the attribute align is used:
<span class="img-caption-{align}">image+caption</span>, where {align} will be your given align: This span is wrapped around the image and the caption. So you have the ability to set different paddings for different floats.

You can always use the wraptag attribute to wrap all with another html element.
Depending on your usage and used wraptag you have to clear the floats.

As of version 0.3 <txp:yab_image /> will produce (X)HTML-strict output. The align attribute in the image element will be completly removed. So the HTML-markup will be different from <txp:image />.

Download

yab_image_v0.3 plugin
yab_image v0.3 source

Changelog
  • 08-11-28 – v0.1
    • release
  • 08-11-30 – v0.2
    • added: alt_caption attribute for alternative captions
  • 09-04-08 – v0.3
    • removed image align attribute in html markup, so output will be (X)HMTL-strict
    • added different css classes for different floats for styling purpose

Article Request Count:
Keywords/tags:
Initially released:
28 Nov 2008
Posted here:
28 Nov 2008
Article modified:
08 Apr 2009

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
TxP · TxD · GG