How to add script tag in django cms text editor - wysiwyg

I am building a website on django-cms. In some pages I want to add javascript to django-cms pages(not templates).
How can I escape the script tag in django-cms wysiwyg editor, whenever I tried to add alert in page, it get executed as soon as write the word "alert".
Any pointers or suggestions would be great
Thanks

script tags (and any other insecure tag) is not allowed in the django-cms default text editor. See http://wiki.whatwg.org/wiki/Sanitization_rules for a list of sanitization rules that get applied.
You cannot override or disable these rules.
If you need users to add script tags, write a custom CMS Plugin (see http://docs.django-cms.org/en/2.4.0/extending_cms/custom_plugins.html) that allows your users to do this. I recommend you don't actually let them write the script tag, but rather provide them with a form that will sanitize/validate the input and generate the script tag.

Related

Does tinymce have an option, via menu, to insert form fields into it or just by editing the code?

Does anyone know of a ready-made plugin that allows adding input, textarea, select etc. on tinymce?
The tinymce.dom.Selection API (https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#select) allows you to select elements or set content in the TinyMCE editor. You can assign the API class to an action or an interaction element like a button or form, and any selected content will be replaced with the contents the API action passes in.
If that's not a good fit for what you need, is there an example of the type of adding input, a textarea, or a select you're looking for?
There are no official plugins that allow such interactive elements to be added. TinyMCE is a text editor that is built to create blog posts, articles, etc. By design, it is not a page builder. However, there may be some unofficial plugins on GitHub that may implement such features.
If you are going to insert forms and text areas that should not be edited or reconfigured afterward, you can use templates. They may come as any valid HTML. Thus, some fixed forms can be just saved as templates.
Another way is, of course, inserting HTML directly into the code.

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.

Creating a new page template in Typo3

I'm using Typo3 for the first time and have been asked to update a site built on it.
Making changes to existing templates so far has been OK since they were mainly CSS changes or replacing images. Now though I need to create a couple of new page templates.
What's the easiest way to go about this? The existing site has a home.html and layout.hmlt in the fileadmin directory. Do I need to create a new html file there, if so how do I use this as a new template for some of my pages?
I'm coming from a mainly WordPress background in terms of CMS (I've nearly given in a recoded the site as a WordPress site since I think it would be quicker at this stage) but I'd really prefer to figure this out.
Any suggestions would be greatly appreciated as I'm pulling my hair out trying to read through the documentation and getting nowhere. The site is using Typo3 version 4.4.6
Thanks!
How you add a new template to your page depends on how templating is handled. Sadly TYPO3 has a poor templating out of the box, so there is most likely an extension that does the job on your site.
Probably one of these:
automaketemplate
templa_voila
flux & fluidpages
Check if one of these extension is installed and add a new page template according to the extensions manual or specify your question afterwards.
Edit:
If plain TYPO3 was used, you'll find something like
page = PAGE
page.10 = TEMPLATE
page.10 {
file = fileadmin/myTemplate.html
}
in your Typoscript. You can add tmplate files like the ones that are already there. To use a different template on a page, you have to replace the page.10.file with the template you want to use. This can be done with a new template record (crated in backend via the template module). But this is a rather anoying procedure to change the template, because you have to create each time you want to change the page template for a page and its children. That is why mostly extensions are used for this.
The out of the box situation gets better with newer TYPO3 versions but in 4.4.6 there are no Backend Layouts that could be uses for a template switch ot something like that.
In Addition to change the mere file you have to adjust the subparts or marker that are filled with the content. You'll find that configured in your TypoScript as well

Wordpress Cusutom Page, With PHP,js html and css

How can I implement a full html,php,js and css page into a wordpress page?
Example:
I have a app.php that has a text box, when You press enter it displays the text with a php echo. With the users profile picture from Facebook.
How Can I inset/implement that into a WordPress page?
HTML/PHP: The simplest way may just be to create an extra template in your theme. You can view WordPress template hierarchy here: Template Hierarchy
JS/CSS: If the JavaScript and CSS makes the most sense to be embedded (it usually does!), you can use hooks and actions in a simple plugin (or potentially your functions.php page) to include the JavaScript and CSS you need.
wp_enqueue_script
wp_enqueue_style
Note: I have not personally used functions.php (found in your theme files) to call these sorts of hooks, but I assume it would work just fine.
If you are using a theme that constantly receives updates, it is worth building a plugin to do the job. If not, it's easiest to just modify the theme.
There are two options as far as I know. First one is that you embed the code directly into your posts, and install the plugin called PHP execution. Second, try to create your own page template, and place your own code in the template. then you can create a page in the dashboard and select the template.

Joomla chronoform insert into existing content

I dont know much about joomla but I have a problem.
I started reading for the chromoform and it is a very nice pugin.
I created a form which I can see in the form manager and also I can view in the url.
but I want ot integrate it to an existing content.
I have a content which contains text, photos etc..
The content is editable with tinymce plugin.
And I want to integrate this form also.
One way to integrate would be to copy the html code and paste in the conent but then if I change the form component the changes would not be also in the conent.
is there a way to include the created form in the content?
Or which is the best one?
Anybody any idea?
Thanx,
Granit
If you also have the chrono plugin installed & published, you can add a form into content (such as an article) using the following syntax:
{chronocontact}form_name{/chronocontact}
This allows you to place the form anywhere within the article - you can preface the form with content (such as a heading) ....
You probably want to use the Chronocontact module (mod_chronocontact), which is provided with ChronoForms. This allows you to insert any ChronoForms form into any module location. The Joomla 1.5 download for this module is here.
Then you just need to define a module location in your template, and create a mod_chronocontact module in that location, with your forms name set up. You'll find having a couple of module locations defined immediately before and after your main content in the template is normally handy, like so:
<jdoc:include type="modules" name="beforecontent"/>
<jdoc:include type="component" />
<jdoc:include type="modules" name="aftercontent"/>