Tinymce insert div Options
imayat12
Posted: Monday, February 04, 2008 2:41:57 PM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
Guys,

Using the tinymce is there a button that can be added to insert / edit a div in rich text editor? At the moment i am adding them using html button then adding the div.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
ntootell
Posted: Monday, February 11, 2008 5:31:20 PM

Rank: Newbie

Joined: 8/28/2007
Posts: 11
Location: Ealing, London
Hi Ismail,

There is a fairly simple way using TinyMCS.

First of all in umbraco / settings / stylings - locate the tinyMCE stylesheet.

Right click and create a new child of the tinyMCE stylesheet. Call it whatever you want, but make sure the alias is "div"

Assign a particualr edit-only color if you want - helps you see when you're in a specific element without changing front end code.

Save it and go to a rich text element.

Select a block of text, and then choos your new style from the "Styles" dropdown. It will enclose your selected text in the div tag :)

Save and heck your front end HTML

Happy coding

n

• loving umbraco • london
Lezzles
Posted: Monday, February 11, 2008 7:17:43 PM

Rank: Devotee

Joined: 8/31/2007
Posts: 82
Location: London, UK
Hi, I'm trying to do something very similar. But...

Neil Tootell wrote:

First of all in umbraco / settings / stylings - locate the tinyMCE stylesheet.
Assign a particualr edit-only color if you want - helps you see when you're in a specific element without changing front end code.


I don't have a tinyMCE stylesheet, so I created an empty one called TinyMCE, and made a "div" style as a child of that. However when I go to the content and click the --styles-- dropdown of the rich text editor, there's nothing there.

Is there something wrong with my tinyMCE set up?
Lezzles
Posted: Monday, February 11, 2008 7:18:39 PM

Rank: Devotee

Joined: 8/31/2007
Posts: 82
Location: London, UK
... oh and how can I create the edit-only style that you mention? Is it a css class?
imayat12
Posted: Tuesday, February 12, 2008 6:04:40 PM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
Guys,

With a bit of dirty hacking I have manged to get a div editor from sourceforge working for tinymce. More info here

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Petr Snobelt
Posted: Wednesday, February 13, 2008 2:42:43 PM
Rank: Aficionado

Joined: 10/2/2007
Posts: 165
Location: Czech Republic
You don't see your new style in dropdown, becource you don't set TinyMce to use your new stylesheet.

Try Developer > DataTypes > RichTextEditor
and check checbox with your new style in Related stylesheets

Hope this help

Petr Snobelt
Lezzles
Posted: Wednesday, February 13, 2008 6:31:47 PM

Rank: Devotee

Joined: 8/31/2007
Posts: 82
Location: London, UK
Ah! That's it! Many thanks.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.