Tinymce Richtext-editor not rendering macro RTE - macros

I'm running a site with umbraco version 4.11.1 and is trying to render the info of a macro within a tinyMCE richtext-editor without any success.
In version 4.11.1 (and perhaps some other versions before this) Umbraco has a button for rendering macros within tinyMCE. If you click this button it will show all the macros that you have been able to render. If I add a macro, it will render out the stuff I've entered in the macro, within an orange-dotted border, which means that the editor understands that I've added the macro.
However, after I save and publish and enter the page where I've added the macro, it doesn't render anything. I came across some posts when I googled the problem and found out that I could trace the problem using a querystring (?umbDebugShowTrace=true) and look through the HTML and see what has been rendered. I found the following HTML:
<?UMBRACO_MACRO macroAlias="Testmacro" />
...which should render, if you ask the people in these posts.
If anyone had this problem, or know how to solve it. Please feel free to participate.
Thanks in advance.
David

Try
string macro = umbraco.library.RenderMacroContent("<?UMBRACO_MACRO macroAlias=\"Testmacro\" ReusableText=\"1112\" ></?UMBRACO_MACRO>", 1112);
string result = paragraph.Replace("<?UMBRACO_MACRO macroAlias=\"Testmacro\" ReusableText=\"1112\" />",macro);
Best regrads

Related

Why don't the official FancyBox 4 bind examples work?

None of the bind examples in the documentation work - https://fancyapps.com/docs/ui/fancybox/api
The standard constructor examples work great, but anything that requires binding does not work. There is no error, but the gallery lightbox doesn't work - clicking an image just opens the image as a link. Here is the exact example code with markup:
<div id="gallery">
<a href="https://lipsum.app/id/1/800x600">
<img src="https://lipsum.app/id/1/300x225" />
</a>
<a href="https://lipsum.app/id/2/800x600">
<img src="https://lipsum.app/id/2/300x225" />
</a>
</div>
<script>
Fancybox.bind("#gallery a", {
on : {
ready : (fancybox) => {
console.log(`fancybox #${fancybox.id} is ready!`);
}
}
});
</script>
That console log never fires.
I'm importing FancyBox like this:
import { Fancybox } from '#fancyapps/ui';
I've tried searching around, but very little info on FancyBox 4 other than official docs and it's frustrating as they don't work. I've tried some of the examples in showcase also, and the same deal. If it's binding, it won't work and no errors are shown. Anyone have any insight into this?
Thanks,
Tom
It works perfectly fine. Since you did not provide a live demo (or at least a full HTML code), then it just not possible to help you.
It is so frustrating to read comments like this, no demo, no useful info, nothing. Maybe you did not include JS file, I do not know ... I would love to help you and to improve documentation, but, sorry, your comment is not helpful at all.
Fancybox is designed to be as easy to use as possible, all you have to do is:
Include two files - CSS and JS file (to get Fancybox object).
Add data-fancybox attribute to your links (or to call Fancybox.bind("YOUR_SELECTOR");)
Thats it! It can not be any simpler.
Sorry, it should have been a much clearer question. I didn't include a demo because it's a big wordpress site in production. It was giving me no useful feedback or errors or anything like that. I build websites day in and day out, so assumed it wasn't just me making some incredibly stupid mistake like a typo or something. I genuinely spent a lot of time on this, it wasn't me being lazy and just posting on stack overflow straight away...
It was me being stupid though.
In the process of making a demo to show you, I found the problem and (as you already know!) it's my mistake. I was able to make fancybox work by instantiating it straight away in my js, but binding (and therefore galleries etc) was not working.
The reason was the javascript was included in the head of the html document before the markup instead of at the bottom of the html document before the closing body. There was nothing for the js to bind to when it was executed.
I wouldn't normally include javascript in the head either but it's a wordpress project and because of some plugin, it's required there. Fancybox 3 worked with js in the head, but I suspect it might be jquery being more forgiving than native js with it's binding to DOM elements?
So, yes, entirely my fault. I was following the steps of the installation and startup guide almost exactly, but that inclusion of the js file in a slightly unusual (or bad practice at least) place was what caused all the issues.

Tinymce Plugin Rendering Source Code With Form Results

I am using Tinymce in a textarea form field to add 'Rich text Editing' to the field. (Form Method = POST).
I used this tutorial to install the files.
In the form itself.. the editor works great.
However....
ISSUE: When my form results are produced, the results include the raw text and source code, instead of the formatted text.
Obviously... the Tinymce plugin has several files and folders. But....
If anyone has experience with the Tinymce plugin, perhaps I am making a rookie, generic, first time error???
Any guidance would be helpful. Thanks.
I figured it out. In my php, I just had to remove htmlspecialchars

Script tags in RTE AEM 6.1

I am trying to create a Editor component that will take inline javascript.
I understand that I can use clientlibs folder for loading JS, but some of the video CDN folks require you to put embed tags with JavaScript in the editor, and I think some of that is also used for rapid development. Currently with the state of RTE, I cannot put a script <script/> tag even after extending it, as it strips it out and only takes the html tags.
Could you please provide any insight if this could be doable in AEM 6.1
Here's what I have tried:
I looked at several post didn't got a clue
extended RTE using Adobe's documentation, but see a script button, that only takes html tags.
looked for hacks that could tell me what part of the code is tripping out </script> tags or could not execute js.
looked for some components out there that does that, found nothing
so far.

joomla tinymce editor problem

hi i am using joomla 1.5 for my site.
in this i fetched the problem of tinymce editor when i clicked on any article the image button are not shown. when i clicked on edit html source button It showing only “{$lang_theme_code_title}” on the Title bar and all body is blank.
so plz help me to resolved out from this problem.
thanks in advance
You should consider trying the JCE editor instead of trying to debug Tinymce. I'm running JCE error free on over 40 sites. It has a superior image manager, link manager, and code view. It installs easily and is highly configurable. The only caveat is that you should disable the Joomla insert image, page break, and read more buttons as JCE has those built in.
http://extensions.joomla.org/extensions/edition/editors/88
See this thread:
http://forum.joomla.org/viewtopic.php?t=62545
Try adding www. to your domain. Most often this is the problem.
I searched joomla project for vars $lang_theme_code_title... and related... There are not. Looked at Tinymce editor, it has javascript driven language file...
Most likely problem is cause by JavaScript. Try using different browser (firefox or chrome).
I read info on some other forums, some claim that temporarily disabling the antivirus solved the problem. I don't think that this will work, but you can try.
If none of this helps, you will need to give more information. Load firefox with firebug and see the NET tab for JavaScript files and Ajax Requests, most likely you'll find something interesting there (i think 500 Error)

TinyMCE writes terrible HTML!

I've currently got TinyMCE incorporated into the backend editor of a simple blogging/page-editing app, but I'm extremely unhappy with the HTML code it creates. It does all sorts of messy things like:
Adding inline style information to span tags that you can't ever find to get rid of without editing the HTML directly.
Nesting tags in nonsense ways (e.g. <p><strong><p><span>some text</span></p><strong></p> just to make something bold.)
Adding empty <p> </p> lines where they don't belong and I'm not trying to create blank lines.
EDIT: I've looked at lists of the other editors out there (including on SO), but I want to know if people firsthand have had better luck getting clean code out of their wysiwyg editors.
Any recommendations for one that outputs better code behind the scenes?
How about a rather drastic alternative, and using a WYMIWYG (What You Mean is What You Get) editor rather that another WYSIWYG editor. That way the author is in full control of the schematic markup as well as the content he/she is entering.
Unfortunately I haven't found one that is as feature rich and usable as tinyMCE, but it seems to have come a long way - see http://www.wymeditor.org/demo/
Use HTML purifier before saving the content into the database.
HTML Purifier
I found JoomlaFCK to be a very good alternative to Tiny MCE.
Hope you like it.
bye
BTW I know it is an old thread but someone might use it. ;)