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

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: TinyMCE & Google Fonts
PostPosted: Mon Mar 07, 2016 3:32 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sun Sep 05, 2010 6:11 am
Posts: 154
Location: Worcester, UK
The latest version of TinyMCE (v3+) makes it easy(ish) to load Google Fonts (other web fonts are available :), into TinyMCE so that editors can see exactly what the text will look like on the page.

Using Design Manager, create a new template of type 'TinyMCE::JavaScript'. Edit the CSS section (approx line 100):
Code:
   {* CSS *}
{$googleFontUrl=',//fonts.googleapis.com/css?family=Open+Sans,Roboto'}
{* add the Google Font url in here(above). Note: the leading comma is required.  *}
      {if isset($cssname) && $cssname != ''}
    content_css : '{cms_stylesheet name=$cssname nolinks=1 nocache}{$googleFontUrl}',
   {elseif $profile->id_design > 0}
      content_css : '{cms_stylesheet designid=$profile->id_design nolinks=1 nocache}{$googleFontUrl}',
   {/if}

Then for the required TinyMCE profile, on the Templates tab, select the 'JavaScript template' that you have just created.

Then clear the CMSMS cache and your browser cache - and you should now be seeing the web fonts in the TinyMCE WYSIWYG. :)

More:
Or go one step further, use CustomGS, Create a field called 'Google Fonts', use a plugin/UDT to fetch the CustomGS variable into the TinyMCE JavaScript template above and also (if set) add the link tag into the head of the page for the front end addition of the font. :)


Love the latest version of TinyMCE: Thanks to Morten Poulsen (silmarillion), Rolf & Mathieu Muths (airelibre), for all your hard work on this. Very appreciated.

_________________
Regards

Kiwi Chris
Web design Worcester & Sheffield, UK


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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:  
HostPapa CMS Made Simple hosting