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

DIVs???

Support forum for WYMeditor.

DIVs???

Postby sehmaschine on Mon Dec 01, 2008 6:47 pm

1. I´ve read a couple of questions about having the possibility to insert DIVs to the editable document/text - but there doesn´t seem to be an answer so far. any news on that subject? I really don´t wanna go back to TinyMCE ... please let me know, if I can help with this, if this feature is planned or if it´s (for whatever reason) too complicated to implement ...

2. A question I´ve been asking over 2 years ago in my first posting: Is it possible to highlight selected tools? e.g., when I put the cursor on a bold element, the bold-tool should be highlighted ... it´s not so import for tools though, but (IMHO) it´s very important for classes (!) - without visual feedback, the user is not able to see which class is selected (of course, this visual feedback should not be seen at the level of the editable document/text).

thanks,
patrick
sehmaschine
 
Posts: 7
Joined: Thu Nov 16, 2006 9:57 am

Re: DIVs???

Postby mr_lundis on Tue Dec 02, 2008 10:04 am

Hello sehmaschine!

1. Take a look at the newly added insert method, you can use it to insert html at the cursor. If that's not want you want, you can use the html method to get, and replace the editor content altogether.

2. Some of this functionality can be found in the hoovertools plug-in (demo). I've also posted a ticket at the trac site suggesting some further improvements that you mentioned.

Cheers mate!
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

Re: DIVs???

Postby sehmaschine on Tue Dec 02, 2008 10:37 am

I´ve tried this, but it´s not working: if I insert a DIV with a P inside, I´m stuck inside that DIV - there´s not way to insert something below that DIV. moreover, I´m not able to change the class of the DIV.

well, here´s what I´d like to do:
the editor should be able to add/edit DIVs incl. some classes (e.g. "column span-3", "colum span-4" etc.). if this is not possible, I´m not quite sure how someone would edit something else than the most basic blog-entry with wymeditor ...

note: hovertools is funny ... but definitely not what I´m talking about.

thanks,
patrick
sehmaschine
 
Posts: 7
Joined: Thu Nov 16, 2006 9:57 am

Re: DIVs???

Postby sehmaschine on Tue Dec 02, 2008 11:07 am

I´ve just recognized, that there´s already a ticket concerning hovertools-stuff (opened about one hour ago). so, I guess there will be work on that issue. see http://trac.wymeditor.org/trac/ticket/141

since I´m the one who did the django filebrowser, I´m happy to see there´s also a ticket for integrating wymeditor with the filebrowser (http://trac.wymeditor.org/trac/ticket/140).

there´s a ticket for my initial question as well: http://trac.wymeditor.org/trac/ticket/88. it´s closed, but the issue doesn´t seem to be resolved. moreover, the first comment (by dixon) suggests that wymeditor won´t include support for DIVs. maybe this should be explained in more detail ... from my point of view, there should be a clear statement on whether handling DIVs should or will be supported by wymeditor. I´m not saying that this is a must-have feature, but it would be much easier to decide whether or not it makes sense to include wymeditor in a given CMS or administration interface (in my case, it´s django).
sehmaschine
 
Posts: 7
Joined: Thu Nov 16, 2006 9:57 am

Re: DIVs???

Postby sehmaschine on Tue Dec 02, 2008 2:58 pm

ok, I´ve tried to solve the DIV-issue but there´s some strange behaviour which I´m trying to describe below.

I´ve added a new button in order to insert a predefined DIV (which is, a 2-column DIV with a paragraph in each column):

Code: Select all
jQuery(wym._box)
.find('li.wym_tools_newbutton a').click(function() {
    wym.paste('<div class="column span-6"><div class="column span-3"><p>xxx</p></div><div class="column span-3 last"><p>xxx</p></div></div><p>xxx</p>');
    return(false);
});


(note: I´ve also tried wym.insert ...)

1. BEFORE the first DIV there´s an empty paragraph inserted, but I´m not able to place the cursor within that paragraph and I also can´t delete it.
2. when placing the cursor within the left column and pressing "ENTER", I´m getting another paragraph (which is fine). but, when I´m adding a list and clicking ENTER 2 times, I´m not getting a paragraph (I´m in the DIV instead ...).

patrick.
sehmaschine
 
Posts: 7
Joined: Thu Nov 16, 2006 9:57 am

Re: DIVs???

Postby mr_lundis on Tue Dec 02, 2008 7:30 pm

Hi again Patrick!


sehmaschine wrote:I´ve just recognized, that there´s already a ticket concerning hovertools-stuff (opened about one hour ago). so, I guess there will be work on that issue. see http://trac.wymeditor.org/trac/ticket/141

Yeah, I posted it, see my previous post.

sehmaschine wrote:since I´m the one who did the django filebrowser, I´m happy to see there´s also a ticket for integrating wymeditor with the filebrowser (http://trac.wymeditor.org/trac/ticket/140).

I love your work, and I'll be using your file manager in another project I'm working on. ;)

sehmaschine wrote:there´s a ticket for my initial question as well: http://trac.wymeditor.org/trac/ticket/88. it´s closed, but the issue doesn´t seem to be resolved. moreover, the first comment (by dixon) suggests that wymeditor won´t include support for DIVs. maybe this should be explained in more detail ... from my point of view, there should be a clear statement on whether handling DIVs should or will be supported by wymeditor. I´m not saying that this is a must-have feature, but it would be much easier to decide whether or not it makes sense to include wymeditor in a given CMS or administration interface (in my case, it´s django).

Support for inline elements is available, adding support for div's is according to jhf a bit more tricky from an implementation standpoint, and I don't really see a need for it in WYMeditor.

A div don't have much of a semantic value, they're mostly used for presentation. WYMeditors primary focus is on the content, not the presentation of it, thus there's no support for divs.

sehmaschine wrote:1. BEFORE the first DIV there´s an empty paragraph inserted, but I´m not able to place the cursor within that paragraph and I also can´t delete it.

That extra paragraph you get is a side effect of using the paste method, as it's intended for inline content/plain text, not block elements.

Why do you need support for divs anyway? Maybe there's some other way of solving your problem...

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

Re: DIVs???

Postby sehmaschine on Thu Dec 11, 2008 10:27 am

I´ve posted a reply two times, but it doesn´t show up - so I´m trying it again.

mr_lundis wrote:Support for inline elements is available, adding support for div's is according to jhf a bit more tricky from an implementation standpoint, and I don't really see a need for it in WYMeditor.
A div don't have much of a semantic value, they're mostly used for presentation. WYMeditors primary focus is on the content, not the presentation of it, thus there's no support for divs.


as mentioned before, it just should be a clear statement on whether or not DIVs are (or will be) supported. I totally agree that wymeditors focus on content is fine as a basic idea. nevertheless, from my point of view it makes the editor useless for at least 80% of all usecases. almost every customer I´ve worked with needs at least basic support for DIVs: a simple example is an article with 2 predefined templates: a one-column template and a 2-column template. this is not possible without DIVs.

re-thinking my question, I´d say that wymeditor should NOT add support for DIVs (but it should be mentioned somewhere). personally, I´m switching back to TinyMCE because of this issue.

thanks,
patrick
sehmaschine
 
Posts: 7
Joined: Thu Nov 16, 2006 9:57 am

Re: DIVs???

Postby mr_lundis on Thu Dec 11, 2008 10:33 pm

As stated by Jean-François Hovinne, div's probably won't be supported by default. However support for it might be added trough a plug-in, but such a plug-in is not available at the moment.

A possible way to solve this (until such a plug-in is available) could be to use separate input fields, one for main content and another optional for the sidebar. If some sidebar content is provided, the system could automatically switch to a two column layout.

Another more flexible solution would bee to do like the django-page-cms project, to parse the template for any place holders and then generate input fields as necessary.

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

Re: DIVs???

Postby flipflops on Thu Mar 05, 2009 10:59 am

Hi

I've wanted to use wymeditor for a long time in projects at work, luckily I am now in a position to say we're going to use it - personally though i really think that things like support for divs would make a huge difference and get more people using this very cool project.

I've written a custom file / image browser to insert a block of html into the editor using the wym.insert() function. The actual browser part works fine but there are a few issues I'd like to try and resolve concerning what happens when I get the div in.

An example of the code that I would paste in would be something like this:
Code: Select all
<div class="image-left"><img src="/upload/filename/upload.0.crrj.jpg" alt="Bay West" title="Bay West" width="85" height="42" /></div>
(This is a just an example, but it is equally valid for things like multiple column layouts or inserting wrapper elemenst for things like embeded flash. For the image example I could wrap the image in a <p> and apply a class to that - meaning i can float the image accross multiple other block elements... but I would much prefer to use divs as containers.)

Anyway I've got two problems which I'd really appreciate it if somebody could help me with:

1. As
sehmaschine wrote:Post by sehmaschine on Tue Dec 02, 2008 11:37 am
I´ve tried this, but it´s not working: if I insert a DIV with a P inside, I´m stuck inside that DIV - there´s not way to insert something below that DIV. moreover, I´m not able to change the class of the DIV.
- is there a solution to being stuck inside the div?

I suppose that I could just make sure that I insert an empty <p>&nbsp;</p> after any div I insert to avoid this problem, but it seems a bit hacky!

2. I can't seem to change classes of the div's inserted - I'm guessing that this is something to do with the containersItems variable ? I was looking at this post http://forum.wymeditor.org/forum/viewtopic.php?f=2&t=469&p=1776&hilit=container

Thanks in advance.
flipflops
 
Posts: 4
Joined: Wed Feb 04, 2009 4:22 pm

Re: DIVs???

Postby mr_lundis on Fri Mar 06, 2009 4:17 pm

Hi!

I just want to clarify that the use of divisions are not officially supported in WYMeditor 0.5. In most cases there are alternate approaches to situations where you'd normally use divs. But If you really need/want to use divs, I guess you'll have to hack around some in the WYMeditor source, as div support isn't a top priority atm. However, any kind of solutions/patches/etc are welcome. ;)

For future versions of WYMeditor we're experimenting with a different, more flexible approach compared to the classical use of iframes. By enabling designMode only for certain elements on a page you one up a whole set of new possibilities, such as inline editing, easier integration with other scripts (drag and drop/colums/whatever) and the use of one toolbar for several editable areas. Were also planing a generic placeholder system which would ease the process of embedding flash files (and the like).


flipflops wrote:2. I can't seem to change classes of the div's inserted - I'm guessing that this is something to do with the containersItems variable ? I was looking at this post viewtopic.php?f=2&t=469&p=1776&hilit=container

Nah, the containersItems property isn't used for any kind of filtering. What happens when you try to change the class of a div, any errors?
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

Re: DIVs???

Postby flipflops on Mon Mar 09, 2009 9:25 am

Hi Mr Lundis

Thanks for your reply, it made me look back at my code and I found out that the <div> styles weren't changing because I'd simply made an error in wymeditor/styles.css -my jQuery expressions were contradictory and so they couldn't be applied.

I think I'm going to try and see what I can do with the <divs> for the timebeing and just see how I get on, after all if a lot of them are just placeholders then they are going to be replaced serverside anyway.

Cheers
flipflops
 
Posts: 4
Joined: Wed Feb 04, 2009 4:22 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron