I am trying to configure tinymce to not allow css styles in style attribute.
I just want to allow one style which is text-decoration. Here is a similar problem
http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=76101 .
The valid_styles option is not present and I dont want to use regexp on my content, coz there got to be some or the other option with tinymce. I searched through the tinymce forums but couldn't find any proper solution.
Can anybody help?
What you need to do is tu use the paste plugin and do some prefiltering when performing copy+paste into the editor.
Use the paste_preprocess setting in your init, using your own cleanup mechanism here:
paste_preprocess : function(pl, o) {
o.content = custom_function_modify(o.content);
},
Related
could anyone tell me if it's possible to make all these(in picture) wp-default links with class .wp-embed .post same height so that it won't look horrible like in picture.enter image description here I know that it is programmed so that the height addapts to text size inside it.
How do i do that, i can't find they way how to overwrite that with CSS. Is it only achievable by PHP / if so how - i can barely read PHP for now...
There are two separate questions here:
How do I change the css on a wordpress site?
The answer is that it will depend on the setup of your site.
-- You may have access to edit the css for the theme by going to Dashboard -> Appearance -> Editor and then finding the style.css
-- You may also have access to edit the css file through manually editting the file on the server.
-- if those first two options don't work, and you are able to add plugins, you can add a plugin to let you add css to the page. Simple Custom Css is one such plugin.
How do I fix this particular css problem?
To answer this question I would need to see more of the css and html for this page
I would like to extract the HTML content created inside a tinyMCE editor to display it without any tinyMCE editor (displaying directly on a page).
I'm aware of tinyMCE's getcontent() function. But is there another function/parameter/plugin that I oversee with which you can extract it as selfrunning HTML code? There are many tinyMCE classes inside the content and it would be hard work to gather them or to convert them back into CSS styles.
So either an extraction with the tinyMCE specific classes would be great or any (automated) conversion from classes to CSS styles would be great. Or ist there any other way I oversee?
There is a format option that can be used to get pure HTML out of tinyMCE content:
tinymce.get('yourEditorId').getContent( {format : 'html'} );
Is there any sort of easy way or helper that would enable to functionality to set custom variable flags. For example I could set a color variable to "blue" in the editor and I could use handlebars to add the "blue" class an element in that post.
EDIT: I ended up having to use a different CMS. Ghost was made intentionally to be simple and my needs require more customization features.
This is something I have been trying to figure out, but (being new to ghost), I haven't found a clean way to do this. Unlike Wordpress, there is no field for this in the editor (I have checked the documentation, nothing similar), so you have to apply some custom solution. Here are two options:
If the styling you want to apply depends on a tag, e.g. if 'movie'-tagged posts need some special styling, you can just add CSS because the {{body_class}} helper adds all the tags to the <body> element as tag-classname, e.g. tag-movie.
If tags are not your option, you could use client side JavaScript, check some condition in the content and apply the styling. I use this to change color of an svg logo when it is placed on a hero image that happens to have the same color as the logo. This requires the hero image of the post to follow some url convention, like post-heroimg3663-blue.jpg. Then you can add some inline Javascript to the <head> to change the color of the logo. Not so good, but it should work.
UPDATE:
If the second option works for you, you could even consider creating a Handlebars custom helper and running any styling (via adding a class) on the server side.
I want to hide the date on this page.
I tried to change it inside joomla but I couldn't. It's not an article but a JKit page and there is no such an option.
I used the "inspect element" feature to find the corresponding css file and line (bootstrap.css #554). When I change the element through the "inspect element" menu its working but when I open the css file and change it, it doesn't work.
Any suggestions how I can hide it?
p.meta {display: none;}
That ought to do it. Granted, any other metadata will also be hidden. You should add this to a custom CSS file and not modify core Joomla or extension files.
I find it hard to believe that jKit doesn't have a setting for that. (Update: I see that jKit is very new and lacks good documentation.) Also, a template override might be more to your liking.
Most Joomla components allow you to control things like this in the options for the items and also in the menu options when creating a menu link (or setting the global options to change the default behavior. If this component does not, make either an alternate layout or a template override (depending on whether you want to always change this or just on this one page). If you go into the template manager, template view there is a system in place that will automatically create a copy of the layout and put it in the right location. Just edit that to show what you want.
Ok so I solved by editing the according .php file of the component.
I just removed the echo line of the date.
Nothing else worked.
I would like to know how to select a default class of a CSS for applying it in tinymce, following this example :
tinyMCE.init({
mode : "textareas",
editor_selector : "textarea_number_1",
content_css : "css/custom_content.css",
default-style : 'NameOfMyClass'; <- here is my problem ! Please, help me :)
}
I have 3 texteareas in my page, only one CSS file, but I want to select a different default class for each textarea.
This is only for the display in the TinyMCE editor, in the php post treatment I delete the 'p' tags from the retrieved content.
Thanks for any suggestion, and if I'm not clear enough, I can explain any point of my problem.
The easy way to do this is to use different configurations: http://www.tinymce.com/tryit/multiple_configs.php
The other way is to have one default object holding settings for all editors and before you use tinyMCE.execCommand('mceAddControl', false, 'your_textarea_id'); you merge the default object with another object holding the additional settings. See for more info also Tinymce how to reduce options for multiple instances