What's the easiest way to add font sizes options to Plone 4's TinyMCE editor?
For some reason a client has this request.
In Site Setup - TinyMCE Visual Editor - Toolbar I can't see any option related to this feature.
This is how it looks in my application:
In /portal_tinymce/##tinymce-controlpanel - Styles add definitions:
Font size 8|span|custom-font-size-8
Font size 9|span|custom-font-size-9
Font size 10|span|custom-font-size-10
etc.
Meaning you can select the options Font size x in your editor. This will be saved as a span with class custom-font-size-x.
When you save this it will already work. But you need the styles to make this visible.
I had an override to tinymce editor already set so I added the styles for each class like:
.custom-font-size-10 {
font-size: 10px !important;
}
in content.css.dtml file. Also add this css in your theme to see the effect in view mode.
I'm creating a tree to select a folder for a file destination so it only supports single selection. The expanders are hidden and I have + or - on the folder icons. Clicking on the folder icon with will expand or collapse the tree. The folder icon as well as the title changes (color) to indicate which folder is selected.
I used custom icons because i had different types of folders.
It works for collapsed selected or collapsed unselected. It works for expanded selected, but I can't get the stylesheet to work for a selected, expanded folder.
The following displays the expanded folder icon with a - sign when unselected
span.fancytree-expanded > span.fancytree-custom-icon.FolderWithChildren {
background-image: url("FolderMinus.png");
}
However I can't figure out the syntax for a selected/expanded folder. I've tried many variation but nothing works. For example;
span.fancytree-expanded > span.fancytree-selected span.fancytree-custom-icon.FolderWithChildren {
background-image: url("FolderMinusSelected.png");
}
Thanks for any help.
Try this
span.fancytree-expanded.fancytree-selected > span.fancytree-custom-icon.FolderWithChildren {
background-image: url("FolderMinusSelected.png");
}
The default icon in the tree view (using gallery-yui-treeview) is a folder icon with an arrow or a page icon . I want to change this to a plus/minus sign. I guess something needs to be done to the skin used but I am not able to figure out what and how. Please help.
Look at this page about YUI skinning : http://yuilibrary.com/yui/docs/tutorials/skins/
Create your own sprite with the folder you want to display (default is : tree_view_icons_blue_01_arrow_beside_folders.gif )
Then, override the span displaying the folder like this :
<style>
.yui3-treeview-label-content{
background-image: url("my_new_folder_sprite.png");
}
</style>
I try to change the font size of package explorer in Eclipse from menu Window → Preferences → General → Appearance, and I fail to change the font size. How can I do that? I use Eclipse v4.2 (Juno) on Windows 7.
On Juno and up you can adjust that font by CSS.
Lookup the files in eclipse\plugins\org.eclipse.platform_4.2.x.y\css for your current style sheet (probably e4_default_win7.css), and then just add the following rule:
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px; /* <-- Desired font size */
}
Update: stylesheets are in eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css folder since Eclipse 4.4 (Luna).
FYI:
From Eclipse v4.4 (Luna):
It looks like the CSS files are no longer in the old folder:
`eclipse/plugins/org.eclipse.platform_4.x.x.vy/css`,
They are moved to the new folder:
eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css
And you must select a theme to apply it, in the menu Windows → Preference → General → Appearance.
This worked for me:
.MPart Tree{
font-size: 8;
}
These are my settings and a screenshot of the IDE.
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree,
#org-eclipse-ui-views-ContentOutline Tree,
#PerspectiveSwitcher ToolBar {
font-size: 8px;
}
.MPartStack {
font-size: 8;
swt-simple: false;
swt-mru-visible: false;
}
You can lookup the CSS style files in eclipse/plugins/org.eclipse.platform_4.2.X.vY/css edit your current style (probably e4_default_win7.css).
Add something like this:
#org-eclipse-ui-jdt-PackageExplorer {
font-size: 20pt;
}
and hope you have a nice and large font (I did not check it myself).
Pro tip: Next time you need to find the CSS Id for a part of the UI, use CSS Spy which you can open with SHIFT-ALT-F5 (after you have installed it).
This worked for me using version 2019-09 on Windows 10:
Locate the directory C:\Users\johndoe\.p2\pool\plugins in File Explorer, replacing "johndoe" with your own Windows user ID.
Depending on what you have done in the past with Eclipse, you should see one or more directories with names that start with org.eclipse.ui.themes.
Select the one with the most recent date modified. In my case its name was org.eclipse.ui.themes_1.2.700.v20190826-0816.
Within that directory open the directory named css.
Open the file named e4_default_win.css in a text editor, and append something similar to the following at the end of the file:
Tree {
font-size: 24px;
font: Mistral; }
Don't pick those specific values! You should pick the font and font size you want. I deliberately made poor choices only to make the effect of those settings obvious in the screen shot below.
Save the file and restart Eclipse. You should see that the font has been changed in the Project Explorer and Package Explorer views, and a lot of other places as well:
Just be clear, the name of the file I edited was C:\Users\johndoe\.p2\pool\plugins\org.eclipse.ui.themes_1.2.700.v20190826-0816\css\e4_default_win.css. The name of the file you edit won't be exactly that, but it should be similar.
On Ubuntu 14.04 (Trusty Tahr) this was the best choice for me:
.MPart Tree{
font-size: 10;
}
In my case I'm using DevStyle plugin with Spring Tool Suite 4.
The font size of project explorer can be changed going to Eclipse menu bar:
Window
Preferences
DevStyle
Extras
Explorer font size
This setting is saved into workspace folder:
\workspace\.metadata\.plugins\com.genuitec.eclipse.ui.common.platform\extra-styling.css
I tried edit directly in file but when open Eclipse the file was overwritten
Using STS 4.8.0.RELEASE based on Eclipse 2020-09 (requires a JDK11)
Finally, from Eclipse 2020-09 (4.17) there is an option "Tree and Table font view" in Window -> Preferences -> General -> Appearance -> Colors and Fonts which changes size of the font in Package Explorer, among others.
If it helps you to spot the setting easier , this is a screenshot how to change the font elsewhere than the font from the editor window
Eclipse is using native Windows widgets and their settings can only be changed from Display Properties / Settings / Advanced / General properties tab. There you can change your screen DPI to alter font sizes.
In Eclipse 4.7.x the CSS files are under eclipse/plugins/org.eclipse.ui.themes_1.2.1.v20170809-1435/css/
In my case I use the dark theme for OSX, so I opened the file e4-dark_mac.css and added the font-size line:
CTabFolder Tree, CTabFolder Canvas {
background-color: #2F2F2F;
color: #CCC;
font-size: 13pt; // new
}
Thanks to Veger's reply, I successfully changed the font of my PHP Explorer in PHP Perspective (with PDT installed). The following CSS code,
#org-eclipse-php-ui-explorer Tree {
font-family: Consolas;
font-size: 21px;
}
are added into my "eclipse-4.3\plugins\org.eclipse.platform_4.3.1.v20130911-1000\css\e4_default_win7.css" file.
You may choose a different CSS file, depending on the theme you choose through Preferences → General → Appearance: "Theme" drop-down list).
I'm using CKEditor with CKFinder in a custom CMS. Users upload and insert photos in articles and that works almost beautifully. The downside is that the default image style is margin/padding:0px, so the images appear crowded when left or right aligned.
Is there a way to set up a default image style in CKEditor, so that when a user inserts an image (whether through CKFinder or entering direct HTML/Source), a padding:10px attribute is added as a style?
You can set the styles within the editor here
CKEditor 3.x Styles
Personally, I use the contentsCss configuration option to provide a stylesheet reference, like so:
CKEDITOR.editorConfig = function(config) {
config.contentsCss = ['styles.css'];
};
And inside styles.css you could do:
img { margin: 10px; }
or whatever you want to do for images.