im using TinyMCE Wysiwyg editor, and when i enter a link, or an image from the same website, it removes the base url
for example, if i enter: http://www.domain.com/somelink.php - i'll get - somelink.php
any ideas how to solve it?
thanks!
Add this few lines in your tinyMCE.init function :
convert_urls:true,
relative_urls:false,
remove_script_host:false,
(Old thread I know but in case anyone else is googling this:)
I had to set convert_urls to false as well.
I am using TinyMCE within Umbraco, so I needed to make the changes in /config/tinyMceConfig.config and then restart the website.
It's very easy to solve.
Instead of Epharion said, simply put this line in your tinyMCE.init function:
tinyMCE.init({
...
document_base_url : "http://www.site.com/path1/"
});
Related
I'm trying to get TinyMCE to work for my site at https://nicer.app/apps/eyJjbXMiOnsicGFnZSI6ImluZGV4In19
But for some reason, the menus won't show.
Not for their simple example code, nor for their full-featured example code.
I'd love some pointers on what i'm doing wrong here.
with help from the bug reporting section at github, the problem was localized to my usage of overflow:hidden on the HTML tag instead of the BODY tag.
changing this fixed the problem :)
You have
menubar: false
...in your configuration so TinyMCE is just doing what you are asking it to do?
I have a custom button that insert some HTML in the editor
First block of code is the button action and the second one is how the HTML is inserted
Any idea why it is rewriting it that way and how to stop it?
I just managed to fix it, in the init function:
valid_children : 'pre[code]'
TinyMCE includes the ability to insert code samples into the editor via its Code Sample plugin:
https://www.tinymce.com/docs/plugins/codesample/
If you want to try to do this yourself you need to do a few things like using the protect configuration option to tell TinyMCE to allow your PHP tags. See this TinyMCE Fiddle for a basic example:
http://fiddle.tinymce.com/Qdgaab
Glad to see a lot of posts about tinymce but there's nothing here that helps me with my current problem.
What I am trying to do is work out how to add "code" to my text with tinymce.
Something like this
Does anyone know how I can do this.
Help would be appreciated.
Mandy
You will need to add pre to the tinymce init setting valid_elements
You need to add to the editor the Code Sample plugin to your editor.
This is the example code to include the plugin from the TinyMCE website.
tinymce.init({
selector: "textarea", // change this value according to your HTML
plugins: "codesample",
toolbar: "codesample"
});
The codesample plugin uses http://prismjs.com/ to embed the code samples within the editor and works out of the box. That is, when a user copies valid code syntax into the editable area the code will be automatically formatted according to Prism default CSS rules.
You need to add prism.js and prism.css to your page for syntax highlighting to work.
Then you will get the code sample button in your editor interface.
Here you can find the Documentation about.
I have a block of text with some of its regions editable via contentEditable property. I am using Paste plugin's paste_preprocess to cleanup the text before pasting it. But when I try it get the o.centent (the clipboard data) it returns empty.
But when I try to do the same with a completely editable section, it works fine.
Any clue?
Thanks,
Imran
Although, it has been fixed. I invite seniors to please comment on the workaround I used to make it running. Please follow the link below:
http://tinymce.moxiecode.com/forum/viewtopic.php?pid=84335#p84335
I have TinyMCE installed on the back end of a site. Some of the html it's accessing isn't totally valid, which I realize is the problem in itself. However, TinyMCE is messing things up by making things valid. I have an <img> with no parents (no <p>, no <div>, etc), and TinyMCE is wrapping the <img> in <p></p>. I'm trying to find a setting that will stop that from happening.
Essentially, I want TinyMCE to allow <img> to be it's own element, rather than a child element, if that makes sense. My current settings are:
tinyMCE.init({
theme : "advanced",
mode : "textareas",
relative_urls : false
});
I had the same problem before I found this: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/forced_root_block
A bit late, but maybe it will help someone in the future
I'm not an expert in tinyMCE but I'm pretty sure those automatic 'clever' source formatting or modification can be configured. Not sure if you have looked into that.
Example of usage of the force_p_newlines option:
tinyMCE.init({
...
force_p_newlines : true
});
Take a look at the reference here:
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
I did a little more searching, and found an answer. First, I actually fixed the inherent problem by wrapping the <img> in a <div style="display:inline;">. However, the configuration solution can be found here:
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_child_elements
I attempted to just force the <body> tag to allow parentless images:
valid_child_elements: "body[img]"
but that denied all other tags from working. So I added some variables, like that link shows, and then I realized the proper solution. But, should anyone need to hack together a solution for an element, that page should solve the problem.