formatting content with <div>

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

formatting content with <div>

Post by thomahawk »

Hello
I am sure this topic must have been discussed, but I can not find any topic on this:

I see users can edit page content with TinyMCE and give elements a class style and a format like or or . Usually it can make a tag around an element or a , but I never got it to make a tag for an element (without using html-editing of course as my CMS websites are usually developed to be used by "odinary" people ;-) ). Is this possible somehow?

Using style and format combined to get to a tag is still complicated for most users though. It would be preferrable to just have one list of formats like in the style menu and choosing from this list just puts an element inside a tag.

Any idea?

Thom
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm

Re: formatting content with <div>

Post by scooper »

Ah - now it can be done but there is a bit of a drawback...

To do it, it you go to Extensions->TinyMCE WYSIWYG and click on the Advanced tab.
Then in the Extra configuration: textarea add a style_format option.
For example:

Code: Select all

	style_formats : [{ title : 'Grey Box', block : 'div', classes : 'greyBox' }]
That will then give you an option in the Styles drop down called 'Grey Box' which will apply the class 'greybox' in a div to your selection. You get the idea.

The drawback is that this will have removed all of your normal styles pulled automatically from your stylesheet. This may not be a bad thing (don't give users too many options) but means that if you want to give them more then you'll have to add them as above rather than just adding them to your stylesheets.

At least that's the way I've always done it - if anyone knows a better way.....

s.
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: formatting content with <div>

Post by thomahawk »

Thank you Scooper for that input. I will certainly try that. I have used the style option before so I know that this removes all other styles from the menu and I agree, it is good for the users to give them only the necessary styles here.

Thom
Post Reply

Return to “CMSMS Core”