I'm creating a website and I want to give the page editors a dropdown selecting when they are editing a page where they can select the background color of that page. The selections should be : White, Grey, Transparent.
Can I add a dropdown selection in the page editor (TinyMCE).
carol
Editor can select background color of page
Re: Editor can select background color of page
I'm not sure trying to do it within the wysiwyg content editor is best. There are two easy ways to do what you're wanting:
Use CGContentUtilities. Create a dropdown content block with your colour options and include it in your page template. Assign it to a variable, then use that variable to create a class. something like:
OR
Use template inheritance, with three child templates containing just the necessary tag for changing the colour, e.g:
Using template inheritance is probably more efficient, but if you don't want to give editors the ability to change templates then the CGCU option may be better. Note: none of the above code is tested, and isn't complete - just gives you the idea.
Use CGContentUtilities. Create a dropdown content block with your colour options and include it in your page template. Assign it to a variable, then use that variable to create a class. something like:
Code: Select all
{$background="{content_module module='CGContentUtils' block='color' label='Choose a background color'}"}
</__body class="{$background}">
Use template inheritance, with three child templates containing just the necessary tag for changing the colour, e.g:
Code: Select all
{extends file='cms_template:YourMasterPageTemplate'}
{block name='bodytag'}
</__body class="bgGrey">
{/block}
Not getting the answer you need? CMSMS support options