Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
Add custom class-name to media/image
Avatar
jaguart #1
User title: jaguart
Member for a month · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Add custom class-name to media/image
I want to be able to float my images - some left, and some right.

Of course, I can add in userstyle.css img.media { float: right; } --or-- img.media{ float: left; } --but-- I can only have one of these apply at a time.

I want to do something like:

{{jamatic:graphite-design-01.jpg?480&class=fl-left|Basic design - Graphite / Grafana }}

and elsewhere on the page:

{{jamatic:graphite-design-02.jpg?480&class=fl-right|Capacity considerations - Graphite / Grafana }}

then I could mix and match to my hearts content. Is there a way to get the markup, esp. for images to include a custom class-name?

Namaste
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4781 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
If all you want is to float left or right and add an image size,  you can do this with dokuwiki syntax

{{image?480|display name}}
{{  image?480|display name}} 
{{  image?480|display name  }}

This will give you the following classes: media, mediaright, mediacenter, which are defined in the CSS.

Or must you have you own class names names for left, right, and center?
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-17, 08:38:05 (UTC +01:00)