[Pmwiki-users] Space Around Graphics?

Patrick R. Michaud pmichaud
Tue Feb 24 06:36:04 CST 2004


On Mon, Feb 23, 2004 at 09:34:41PM -0800, Roy wrote:
> Is there a way to get PmWiki to insert space around graphics (that are 
> wrapped in text)? For instance, here's the code that's generate after 
> uploading an image...
> 
> <img src='./RuralCanyon/oaks.jpg' border='0' alt='' align='left' /> Blah 
> Blah Blah
> 
> In the past, I would insert hspace=5 or vspace=5, or put the graphic in 
> it's own SPAN, to get some distance between the graphic and the text that 
> surrounds it.
> 
> How do I get to the piece of the code that generates the image HTML, so 
> that I can customize the code generated?

If you want to add space to just one or two graphic images, use a
WikiStyle:

  %hspace=5% http://server/image.gif %%
  %hspace=5 vspace=3%  http://server/image.gif %%

If you want to add space around all images, make a CSS entry to do it:

  #wikitext img { padding:5px; }

You can also have local/config.php change the code that PmWiki uses to 
generate images:

  $UrlImgFmt = "<img src='\$Url' border='0' alt='' hspace='5' vspace='5' img>";

The "img>" at the end of the tag is required if you want images to be
able to float left or right (it doesn't actually appear in the output).

Finally, to keep text from butting against images I often just add the
padding space directly into the image itself.  A similar thing holds true
for image borders, rather than render the border with border='1' in the
image tag, I'll sometimes add the border onto the image itself.  TIMTOWTDI. :-)

Pm



More information about the pmwiki-users mailing list