The Tree of Widsdom

智慧の樹

MediaImg

^do( MediaImg, filename, title, [class, href, width] )^

Type: Macro

Purpose: Embeds an image (no caption)

The MediaImg macro inserts an image with no caption. The title argument determines both the tool-tip text and the alternative text. The arguments:

  • Arg3 (class): The default classes for your image are img-responsive img-center img-well, meaning that the image will be centered, responsive, and in a well. Override this with convenience classes for image position (img-left, img-center, img-right) and size (img-large, img-medium, img-small, and img-xs). Adding any override will remove img-well effect. (Thus, to only remove the well, use a redundant img-center.) Adding img-left or img-right will invoke img-medium. Then stylize with img-well or img-shadow. Ultimate convince with minimal intervention!
  • Arg4 (href): Unless an optional 4th argument is given, the image links to a full resolution version in another tab.
  • Arg5 (width): Optional 5th argument fixes the width.

Hover below to reveal BoxPress code

^do(_striptags, "$2")^<figure ^if($3)^class="center-block $3"^endIf^><a target="_blank" href=^if($4)^"$4"^else^"^root^img/$1"^endIf^><img src="^root^img/$1" alt="^value($tmpStr1(_stripnote))^" title="^value($tmpStr1(_stripnote))^" ^if($5)^width="$5"^endIf^ class="img-responsive center-block m-b-0 ^if($3)^^value("$3".replace("(img-left|img-right)",").replace("(img-well)","well well-sm"))^^else^ well well-sm^endIf^"></a></figure>

MediaImg sample

This is the markup that is rendered below

^do(MediaImg, "sample.jpg", "I’ve included some text here for alt and title, but it’s optional. You’ll see this text as a tooltip.")^

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

I’ve included some text here for alt and title, but it’s optional. You’ll see this text as a tooltip.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.