tinymce,plone,plone-5.x , Obtaining the “default” mockup TinyMCE configuration on Plone 5


Obtaining the “default” mockup TinyMCE configuration on Plone 5

Question:

Tag: tinymce,plone,plone-5.x

I'm trying to configure TinyMCE inside Plone 5 template (so: not the z3c.form widget type).

Using the TinyMCE Mockup patter you quickly learn how to display a rudimentary TinyMCE configuration (without any i18n support). But how I can get the "default" configuration applied to TinyMCE when it's loaded for default content types like a Plone page?

What I'm looking for a way to get the right value for the data-pat-tinymce HTML attribute.


Answer:

I think what you're asking for is to do something like this...

First, get the default tinymce pattern configuration:

from zope.component import getMultiAdapter
import json
pattern_options = getMultiAdapter(
  (context, request, None),
  name="plone_settings").tinymce()['data-pat-tinymce']
tiny_options = json.loads(pattern_options)

Then, manipulate the tiny_options dictionary and customize to your needs and provide it to your data-pat-tinymce attribute with json.dumps.


Related:


Default config of tinymceBundle


symfony2,tinymce
I can't seem to set the default configuration for stfalcon's tinymce bundle. I followed the instructions given here to no avail. This is what I have in my config.yml: stfalcon_tinymce: theme: advanced: plugins: - "advlist autolink lists link image charmap print preview anchor" - "searchreplace visualblocks code fullscreen" - "insertdatetime...

Create copy of plone installed onto another server with data


python,linux,plone
To create another exact copy of the plone install running along with data, is it sufficient to copy buildout.cfg and Data.fs with same version of Plone on the other install? Does it restore the uploaded pdf and image files that have been done on the first server? Using plone 4.2.1...

Reactjs together with TinyMCE editor code plugin


tinymce,reactjs,tinymce-4
I'm using Reactjs together with the tinyMCE 4.1.10 html editor (together with the code plugin) and bootsrap css + js elements. A fairly working setup after a few quirks with the editor have been removed (manual destruction if the parent element unmounts) Now the question: The textarea input of the...

What can cause Sprockets::CachedEnvironment error?


javascript,ruby-on-rails-4,tinymce,erb,centos6
My RoR application falls down with the following error: ActionView::Template::Error (undefined method `attributes_for' for Sprockets::CachedEnvironment:0x00000005baf3d8 As I found out this error happens when the javascript in the html.erb template is rendering. Also I noticed that in all templates where it happens exists tinyMCE initialization command. I suppose, that it is...

Upgrade step to remove profile


plone,upgrade,genericsetup
We have one package that we identify that we don't need its profile (collective.js.cycle2) so I need to write an upgrade step to remove the existent profile. Looking at the code I usually have to update profile, I found that in the end it calls: portal_setup.runAllImportStepsFromProfile(profile, purge_old=False) Is it a...

How do I override the main template in Plone 3?


plone,zope,plone-3.x
I'm working on a theme product for Plone 3.2.3. My theme product works perfectly on the default Plone installation. However, when I apply it to our existing site all the features of my theme are applied except the modifications to the main template. The product file structure is based on...

SilverStripe wysiwyg style constraints


css,tinymce,wysiwyg,silverstripe
Is there any way to prevent certain custom wysiwyg styles to be applied to certain HTML elements? Suppose I have two styles called "red" and "framed". One colours text red and the latter puts a frame around photos. Can I control which styles are available when highlighting text or an...

How can I run archetypes.querywidget test suite locally?


testing,plone
I need to make a fix at archetypes.querywidget and it's buildout is not creating the bin/test script. Should I use buildout.coredev? do I need to change it's checkouts to run the tests?...

Show/hide tinymce with radio buttons


c#,asp.net,asp.net-mvc,tinymce
I try to show/hide a tinymce with radobutton. Like yes/no. So there are two radio buttons. yes - will show the tiny mce and no will hide the tinymce. I have this: showing tiny mce: <div class="form-group"> @Html.Label(Resources.Entity.Product.PdfMessage, new { @class = "text-bold control-label col-md-2" }) <div class="col-lg-6 col-md-8 col-sm-10...

Display TinyMCE editor to textareas after Jquery .load onclick


jquery,html,tinymce
I am trying to add a TinyMCE WYSIWYG editor to my textareas. I have a table with a td that the user can click to .load a form with input fields, labels, textareas etc. My td looks like this: <a href="#" id="display_info" onclick="displayFacilityInformation(61)">Something</a> displayFacilityInformation() looks like this: function displayFacilityInformation (facID){...

How to shim tinymce in webpack?


javascript,node.js,tinymce,webpack,shim
I'm trying to get tinymce recognized by webpack. It sets a property named tinymce on window, so evidently one option is to require() it using syntax like this (described at the bottom of the EXPORTING section of the webpack docs): require("imports?window=>{}!exports?window.XModule!./file.js But in this example, how is ./file.js resolved? I...

symfony 2.5 content editable web page and save


php,mysql,tinymce,twig,symfony-2.5
I am working on a project using symfony 2.5 It should be able to have a webpage that is editable text, bg color, bg image, and images etc. I use tinymce for inline editing. my question is how should I save these web pages to the database. I am going...

How to transfer a structure from one Plone to another


plone,data-migration,plone-4.x
I have a Plone instance which contains some structures which I need to copy to a new Plone instance (but much more which should not be copied). Those structures are document trees ("books" of Archetypes folders and documents) which use resources (e.g. images and animations, by UID) outside those trees...

Redirecting Site Root URL to its Language Root Folder


plone
Environment: Plone 4.3.4.1 , plone.app.multilingual 2.0.0 (from github) I have two Plone sites, both with p.a.m enabled, but they behavior differently when visiting to their site root URL. Say, visit http://www.site1.com/ will redirect to http://www.site1.com/zh , that is what I need. But http://www.site2.com/ will show its item listing, that I...

How do you make changes from a new windowManager window?


javascript,tinymce,tinymce-4
I'm fairly new to JavaScript, so I'm learning as I'm doing things. On my internship I was asked to adjust a WYSIWYG html editor so it can be used with e-mails. I'm using placeholders to later be replaced by the user. My question: How do I detect the input in...

How to register a browser layer programmatically


plone,genericsetup
I know that a browser layer can be registered using GenericSetup and one XML file, but I need to make it programmatically. Is this possible?...

How to set Plone to redirect to came_from after logout


python,plone,plone-4.x
I want to set a plone website to redirect to came_from parameter in url after user logout. For login I set string:${globals_view/navigationRootUrl}/login?came_from=${context/absolute_url} and it is working. For logout this is not working. I tried also with its event: <subscriber for="Products.PlonePAS.events.UserLoggedOutEvent" handler="blabla.goCameFromAfterLogout" /> using: def goCameFromAfterLogout(event): """ Redirects user to came_from...

Classic ASP Post to MS Access DB - Doesen't Work from Textarea Editor


ms-access,asp-classic,tinymce
I use a textarea modifyed with TinyMCE but when I send the form to New.asp which is my "New Post" page, it simply won't upload the content to the server. That is the error... Microsoft Office Access Database Engine error '80040e14' Syntax error (missing operator) in query expression ''&#60;p&#62;-: CLEANED...

cant focus on tinymce inside colorbox


jquery,tinymce,colorbox
I am creating a tinymce editor inside a colorbox. The first time the colorbox loads up, it works fine. Subsequent times, I can't click or tab to get focus on the tinymce editor. I am using tinymce.EditorManager.execCommand('mceAddEditor', true, 'tbContent'); and tinymce.EditorManager.execCommand('mceRemoveEditor', true, 'tbContent'); to create and remove the editor when...

Plone Archetypes redirection after creation


python,redirect,plone,archetypes
I've searched in Internet for a while, but I haven't found out anything useful... I want to do something as simple as redirect the page to the listing page (folder) after save/create an AT content type. I already know I have to use validate_integrity.cpy and write my redirect's logic there,...

TinyMCE - how to add custom insert template button for each template


javascript,tinymce,zurb-foundation,tinymce-4
For keeping site responsiveness and applying standard grid system (I'm using Zurb Foundation) on custom user data entered on my web application I have defined some templates in tinyMCE to insert custom user data and pages on my web application. But it only includes one button in toolbar which is...

Plone- In a dexterity.EditForm why is attempting to disable a widget causing a ConstraintNotSatisfied error?


plone,dexterity
I'm trying to disable a widget in a dexterity.EditForm, but I'm getting an error . Here is a part of my interface class with the particular widget I want to disable class IRestaurant(IPlace): restaurant_code = schema.TextLine(title=_(u""), required=False, ) IPlace is a form.Schema that IRestaurant inherits from. (from plone.directives) Here is...

How to add tinymce 4.x dynamically to textarea?


javascript,jquery,html,tinymce,tinymce-4
I have a little problem with adding tinymce dynamically to textarea after init. tinymce.init({ selector: "textarea", theme: "modern", height: 100, plugins: [ "advlist autolink image lists charmap print preview hr anchor pagebreak spellchecker", "link searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "save table contextmenu directionality emoticons template paste...

Plone/IRelatedItems- How can I programatically set relatedItems of a dexterity content type?


python,plone
In an event, IAfterTransitionEvent, I'm trying to capture the event of an object being published and when the object is published, two objects are created and I want to relate. In the type xml file of the object that's being published, I added to behaviors: element value="plone.app.relationfield.behavior.IRelatedItems" So that I...

Where is the main space used up in Plone file upload?


plone,zodb,plone-4.x
In plone I have uploaded only 800 GB of data (mainly pdfs), it has occupied already 2 TB of hard disk space. Where exactly is the space being used up? I am using collective.documentviewer with its default settings. and plone 4.3. Are files stored by documentviewer changed to various image...

django: disable tinymce for one certain field


python,django,tinymce,field
I have a lot of models with tinymce(django-tinymce) enabled by default for TextFields and this is ok. But for one field I don't want to apply tinymce widget (in admin interface). Please tell me how do I implement that? class Page(models.Model): one = models.TextField() two = models.TextField() three = models.TextField()...

full text searching for various external formats plone 4.2


plone
I wanted to enable full text searching in plone 4.2(windows).I ultimately installed Products.OpenXml and ftw.tika addon using buildout and properly adding their packages in eggs as well as zcml category, after which they both show in portal_transforms tools. i.e included this in buildout.cfg and ran it. eggs = Products.OpenXml ftw.tika...

Reportlab Unordered List not showing bullets


python,tinymce,pdf-generation,reportlab,rml
Whenever users input unordered lists using TinyMCE and it will look like this under source code <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li></ul> When it renders to PDF using reportlab, it shows up without bullets all on the same line like this: item 1 item 2 item 3 Below is...

Dealing with the error: A different document with value xxxx already exists in the index


plone
What would cause multiple documents on my catalog to have the same "unique id"? Effectively an error like this: ERROR Products.ZCatalog A different document with value 'xxxx341a9f967070ff2b57922xxxx' already exists in the index.' And how do I go about fixing it?...

What's the buildout:zcml option for?


plone,buildout,zcml
In one of my projects' buildout.cfg files I have something like this: [buildout] ... zcml = my.package plone.reload ... Everything works fine but I'm still puzzled about what's the reason some packages do need to be listed here and why others don't. What's the purpose of it to begin with?...

How to conditionally require a field based on a selection in a form?


forms,plone,z3c.form
I am using Plone and z3c.forms. There is a field at the top that selects what content object we are creating. It then shows the fields needed to build that object. I need to be able to conditionally require fields based on what content object is selected at the top...

Permission denied when implementing JavaScript within an iframe from the parent page


javascript,jquery,iframe,https,tinymce
I am trying to implement JavaScript within an iframe from the parent page. I read Invoking JavaScript code in an iframe from the parent page, however, get the following error. Error: Permission denied to access property "showIt" document.getElementById('targetFrame').contentWindow.showIt(); I've tried implementing this both on jsfiddle as well as my server...

Plone - Syntax Error when doing hello world tutorial


syntax-error,plone
I am following this "hello world" tutorial on plone.org But I stuck in one moment due to error: [email protected]:~/Plone/python_dev/env-27# cd hello_world [email protected]:~/Plone/python_dev/env-27/hello_world# ../bin/python bootstrap.py Traceback (most recent call last): File "bootstrap.py", line 70, in <module> exec urllib2.urlopen(setup_url).read() in ez File "<string>", line 1 <!DOCTYPE html> ^ SyntaxError: invalid syntax I...

Obtaining the “default” mockup TinyMCE configuration on Plone 5


tinymce,plone,plone-5.x
I'm trying to configure TinyMCE inside Plone 5 template (so: not the z3c.form widget type). Using the TinyMCE Mockup patter you quickly learn how to display a rudimentary TinyMCE configuration (without any i18n support). But how I can get the "default" configuration applied to TinyMCE when it's loaded for default...

Can zope.publisher.browser.BrowserView be used in Plone?


plone,zope,zope3
Given that Products.Five is an integration layer to make the Zope Component Architecture (ZCA) usable in Plone: Is it possible to use zope.publisher.browser in Plone or do I have to use Products.Five.browser to import BrowserView? The former produces a traceback: 2015-06-04 14:47:02 ERROR Zope.SiteErrorLog 1433443622.720.549321919726 http://localhost:8080/Plone/@@hello Traceback (innermost last): Module...

Javascript form processing issue in Plone


javascript,plone,plone-4.x
I have an HTML form created in a page in Plone that is to process Javascript code I have been given upon submission. The Javascript has been placed in plone_skins > custom. The code is to check for a keyword in the URL calling the page, which indicates the address...

Moxiemanager not opening browse window in dialog


tinymce,moxiemanager
I recently upgraded my moxiemanager tinymce plugin to the new 2.0 version. I use the Tinymce wysiwyg (4.1.9) in a jquery dialog popup. Everything seems to be working fine, until I click Upload > Local Machine to upload a new file. It will not open the browse window in any...

How to hide a fieldset (tab) in Plone add/edit form


plone,fieldset,dexterity,z3c.form
I have some code in dexterity content type, as below: form.fieldset( 'transitionsLog', label=_(u"Transitions Log"), fields=['t_log'] ) form.mode(t_log='hidden') t_log = schema.TextLine( title=_(u'Transitions log'), ) In add/edit form, the field t_log hide but fieldset tab 'Transitions Log' still show at form, as above... I have no idea to hide "Transitions Log" tab...

Multiple contact forms in a Plone website


python,plone,plone-4.x
I have /contact-info, as default contact page (http://docs.plone.org/develop/plone/functionality/contactform.html) for my plone website. I want to add a new contact page for a subfolder but with different settings (like from email address and fields). I'm trying to create a new contact page using Products/CMFPlone/skins/plone_templates/contact-info.cpt as model, but I think maybe it...

Custom dimension in collective.googleanalytics report


python,google-analytics,plone,google-analytics-api,plone-4.x
I'm using collective.googleanalytics (https://pypi.python.org/pypi/collective.googleanalytics) to add some GA reports to a plone site. How can I use custom dimensions (like ga:dimension1 or ga:dimension2) in a new google analytics report? I can't see any related option in Query Dimensions field....

Google transliterate not working inside tinymce editor


javascript,tinymce,transliteration
I tried to integrate google transliteration in to a project where the editor is tinymce. My textarea: <textarea id="to_be_translated" style="width:100%"></textarea> I followed this tutorial for integrating google transliterate and gave my textarea's id to_be_translated to the following line control.makeTransliteratable(['to_be_translated']) and used the following code to implement Tinymce for the above...

How to declare a subscriber that will be enable for only one plone site?


plone
In a Plone instance I have two plone sites. In one of them, I have a product dedicated to it. I want to declare a subscriber in that product for Products.PluggableAuthService.interfaces.events.IPrincipalCreatedEvent that will be fired only for this plone site. I have tried with zcml:condition="installed my.product" but it test only...

Display Datetime picker on tiny mce plugin


javascript,jquery,jquery-ui,datepicker,tinymce
I am using j-query tinyMce plugin as editor . Everything was going fine . But now i need to add a custom button so that i can insert date from a date picker . What i did is added a button in the toolbar . and its working to show...

When not using UnifiedInstaller, why is sys.path not populated?


plone,buildout
When using zc.buildout to install Plone without the UnifiedInstaller, the resulting bin/buildout script has a truncated sys.path. I am used to seeing pages of eggs listed there, where I now only see these: import sys sys.path[0:0] = [ '/home/campbell/Plone/repos/bika.uw/lib/python2.7/site-packages', '/home/campbell/Plone/repos/bika.uw/eggs/setuptools-15.1-py2.7.egg', ] When running bin/zeoserver and bin/zeoclient, everything works as expected...

Can I use plone.protect 3.0 with Plone 4.3?


forms,security,plone,csrf,plone-4.x
Since version 3, plone.protect provides automatic CSRF protection. Plone 4.3 includes, by default, plone.protect 2.0. Can I just upgrade to start using this feature in Plone 4.3?...

How can I change color of tinymce background onchange using query


javascript,jquery,html,css,tinymce
I have a form with various input fields and if they change I want to change the background color I use the following code which does what I need $( document ).ready(function() { $('textarea, input, select').change(function () { $(this).css({ 'background': '#D6FFD6' }); }); }); The problem comes with one of...

In Plone, how do I fix Archetypes content that is missing the cmf_uid() annotation?


plone
I'm using Plone 4.3 with relstorage and I've somehow managed to lose the cmf_uid annotation on some of my content objects. This prevents collective.iterate from being able to check in content. Is there an easy way to have Plone walk through the database and re-add cmf_uid where it is missing?...

tinymce pagebreak unclosed div


javascript,php,html,tinymce
I use tinymce pagebreak to seperate content and in php side I want to show just second part after pagebreak: $str = '<div> <p dir="rtl" style="text-align: justify;"><span style="font-size:medium;"><!-- pagebreak --></span></p><p>fdsfsdf f sf f s</p></div>' $arr = explode("<!-- pagebreak -->", $str); and when I want to just use echo $arr[0] or...

Usage of ZODB temporary storage


plone,zope,zodb
In plone.recipe.zope2instance there is an option called zodb-temporary-storage that is used to replace Zope's default temporary storage definition. When is this recommended? What are the upsides and downsides?...