Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

CMS styling based on pagetype


Go to End


854 Views

Avatar
merrick_sd

Community Member, 99 Posts

19 August 2011 at 9:01am

I have some page types setup so people can choose. Page or TwoColumnPage or ThreeColumnPage.

TwoColumnPage has an additional htmlContent Field ColumTwo
ThreeColumnPage has 2 additional htmlContent Field ColumTwo, ColumThree

Setup Reasoning
1. because div management in tinymce editor is difficult
even if i use the tinymce template feature.
2. obviously don't want tables

this is a nice setup, but am wondering if i could give the user some hints as to column widths in the tinymce editor

I have notice that I can limit the Tinymce "inner" content area by putting styling in the typography.css file as that gets loaded in the CMS area.

I even managed to put in a background image to show the max column width.

----------typography.css extract ----

#tinymce.mceContentBody.typography{

width: 284px;
background-image: url(../tinymce/284_3col_mce_bg.gif);
background-repeat: repeat-y;
background-position: 10px 0px;
}

------------------------------------

the trouble is this affects all tinymce editors in the cms.

I can't seem to figure out how to be specific?

Question
Can i add a css file based on the page type the user is on "within the Admin area" ?

I don't think you can be specific like
#ColumnTwo #tinymce.mceContentBody.typography{

width: 284px;
background-image: url(../tinymce/284_3col_mce_bg.gif);
background-repeat: repeat-y;
background-position: 10px 0px;
}

The only reason behind this is the aid the Person doing the Content editing. Anything to force common sense :)

Attached Files