close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding divs to ckeditor

Thread began 11/16/2012 4:43 pm by bill3786 | Last modified 11/19/2012 11:34 am by Jason Byrnes | 4521 views | 3 replies |

bill3786

Adding divs to ckeditor

In ckeditor is it possible to wrap lines of text in the following div

<div class="content">Line of text 1</div>

This is part of a fading jquery script that displays each line of text in turn. In order to do this each line of text has to be wrapped in the div.

The cms content area is like this

<div class="content">Line of text 1</div>
<div class="content">Line of text 2</div>
<div class="content">Line of text 3</div> etc

Need this to be a simple operation for the client so that any of the lines of text can be removed and/or new ones added whenever they want. They wont be able to work in source view so is there a way to do this.

Sign in to reply to this post

Jason ByrnesWebAssist

use the Div button in the toolbar to add a new div. see the attached screen shot.

Sign in to reply to this post

bill3786

Ok thanks, that helps but it's not quite what I wanted.
I hope this explanation is easy to follow, I've shown a series of screenshots in the atachments. Bearing in mind the client cannot work in source view.

1.jpg is what we have to start.
We want to add a new fact after the first one and end up with 5.jpg and 6.jpg (see below).
So the client adds a line break after the first line and it looks like 2.jpg
But this adds the line break after the start of the second line div as shown in source view 3.jpg
Then when the client uses the "add div" button and adds the class name "content" it adds the new div inside the original second line div as shown in 4.jpg

For the fading jquery script to run through the lines of text in order the source has to be as 6.jpg (couldnt upload 6.jpg because of upload limit so here it is pasted below

<div class="content">
A zebra is white with black stripes, not black with white stripes.</div>
<div class="content">
This is the new fact that is to be added.</div>
<div class="content">
It's impossible to fold any normal piece of paper more than 7 times (try it!)</div>
<div class="content">
On average a four year old asks 437 questions a day.</div>
<div class="content">
It is impossible for most people to lick their own elbow.</div>
<div class="content">

If the client was familiar with html or I thought they could be trained successfully to consistently type in the code in source view then this wouldnt be a problem but this is not the case.

I hope you can follow this!

Sign in to reply to this post

Jason ByrnesWebAssist

Unfortunately, this is a limitation in How CKEditor works when adding divs. it will treat the new div as a part of the existing div.

the only work around i have been able to find is to add a new block element to the page like a bulleted list, that would get added outside of the existing div, then with the bulleted list selected, add the div, this would add the new div around the bulleted list.

now in the tag selector, select the UL tag, and click the bulleted list button again to remove it, I have found this successfully creates the new div outside of the existing divs, the only draw back is that content inside the div is enclosed with a p tag that would need to be removed in source code.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...