Forum closed. New forum available at http://community.wymeditor.org/

Wrapping objects

Support forum for WYMeditor.

Wrapping objects

Postby s.emiliozzi on Sun Mar 15, 2009 4:16 pm

Hello, I have some questions:

1) How to set the initial wymeditor box area? (I modified the css of the skin I'm using, but I guess it's not the recommended way)

2) I need that each image I put into the content has a predefined class (i.e. <img src = "myImg.jpg"/> --> <img src = "myImg.jpg" class="myClass"/>). What is
the best way to achieve that?

3) I also need to wrap each image with a <a href> which has the href attribute equal to the src attribute of the wrapped image and (only if present) the same title attribute of the wrapped image (i.e. <img src = "myImg.jpg"/> --> <a href = "myImg.jpg"/><img src = "myImg.jpg"/></a> and <img src = "myImg.jpg"/> --> <a href = "myImg.jpg" title ="myImage"/><img src = "myImg.jpg" title ="myImage"/></a>) Is there a way to achieve that using wymeditor? Right now this processing is done server side, but I guess that would be better to have it done in the editor, if possible.

Thank you in advance for any help!
Stefano Emiliozzi
s.emiliozzi
 
Posts: 1
Joined: Sun Mar 15, 2009 4:02 pm

Re: Wrapping objects

Postby mr_lundis on Sun Mar 15, 2009 6:41 pm

Hi Stefano and welcome to the WYMeditor forum!

1) A simple override 'll do:
Code: Select all
.wym_skin_default .wym_iframe iframe { height: 300px !important; }

2) I'd give the element containing the images an id/class instead, much cleaner, and a whole lot easier to implement.

3) If you already have an automatic system for doing this on the server side, I'd continue to use it. Imagine that one day you want to wrap all the images in divs/paragraphs/whatever, it'd be a lot easier just to do that in one singe place than on every page in you system. The same is true for #2.

You could of course implement #2 and #3 as some kind of plug-in if you want/need to, but I'd say that the simplest solutions are probably the best ones.

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests