Textile attributes for attached images

Published on 09/06/12

I just finished adding a feature that will allow you to add attributes to image attachments. You can add id, class, or style attributes using the normal textile syntax.

The only caveat is that the class and id attributes have to be placed before the style attributes or they will be skipped.

One of the big things you or your clients will be able to use this for is to size images after they are uploaded. Normally, Net-at-hand processes images and scales them down to fit within the main content area of your site. This will still happen, but you’ll be able to use CSS to shrink them further by setting the width or the height.

Title of the image attachment

Just to give you an example, the image to the right is attached to this blog post and is placed in the post using the following code:
!(#happy-couple){width: 50%}1!> This generates an image with an id attribute of “happy-couple” and a style attribute of “width:50%”.

Note that this does not support the language syntax available in textile, though it is supported for most other attributes.

In fact, this also demonstrates that you can still use the align right or left syntax for images.