• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Editor can select background color of page
PostPosted: Sat May 12, 2018 3:30 am 
Offline
New Member
New Member

Joined: Sat May 05, 2018 8:24 am
Posts: 2
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Editor can select background color of page
PostPosted: Sat May 12, 2018 1:57 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 440
Location: Victoria, BC
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:
Code:
{$background="{content_module module='CGContentUtils' block='color' label='Choose a background color'}"}
</__body class="{$background}">


OR

Use template inheritance, with three child templates containing just the necessary tag for changing the colour, e.g:
Code:
{extends file='cms_template:YourMasterPageTemplate'}
{block name='bodytag'}
  </__body class="bgGrey">
{/block}


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.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting