CKEditor custom config not working in draft-workspace - ckeditor

I created a custom config file for CKEditor using a yaml-file as suggested and registered it in my extension for my custom elements.
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['custom_rte'] = 'fileadmin/templates/css/custom_rte.yaml';
This works fine as long as I'm in the default workspace.
When I switch to the draft workspace and save an element, the config is lost and I get the default Toolbar, without my custom css and buttons.
Any idea what this could cause?
Typo3 8.7.15

The solution was actually pretty easy.
I had to set the default preset for the CKEditor in the extension, instead of using the custom one and then set that in the Page TSConfig.
So this works (in ext_localconf.php)
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'fileadmin/templates/css/custom_rte.yaml';
That way the CKEditor always uses my custom yaml-file. No Page TSConfig needed.

Related

Disable CKEditor on Page Load

I am using CKEditor to provide a WYSIWYG for one of the fields I am storing in the database.
There are records marked as deleted and so editing them is forbidden. I managed to disable all the input fields inside my form by adding the disabled attribute on the fieldset element. This approach however doesn't disable CKEditor.
I'm not sure what version this got implemented but on CKEditor 4 using
CKEDITOR.config.readOnly = true;
seems to solve the issue.

Joomla dev - Probleme with an editor field in theconfiguration context

I'm currently developing a component that includes an "editor" field in his parameters (the form mandated by the com_config).
The value of the "filter" attribute of the field in the "config.xml" file is : "raw".
Despite all the HTML here is fired, remains only the textual content.
On this website I'm doing the same thing for the parameters of a plugin and It work very well here, so I think that it's not a story of Joomla! configuration or editor configuration (I use the same editor with the same user account) ...
Is it a constraint imposed by the configuration component ??
Thank you for your lights!
It is difficult to say without some code to look at, but the raw filter should not remove HTML.
You could try building the same functionality using http://www.component-creator.com and view the code it generates or simply just use the built component instead of your own code.

Adding rating feature to Jetpack Carousel

I'm using jet-pack carousel in my gallery website and i want to add image rating capabilities. I have the "wp-postratings" plugin running on the rest of my site.
I'm assuming that i could add this to individual images as wp treats each image as a post, if so where would i find the template i should add this code to?
All the plugin requires is that i add one line of php to the page/image but i can't figure out where it shoud go as the code for carousel seems to be entirely js and php generated.
demo: http://so.devilmaycode.it/adding-rating-feature-to-jetpack-carousel/gallery/
in a js file jetPack_meet_wpPostRating.js copy this code (place the file in the js folder of your theme):
https://gist.github.com/aSeptik/9739808
in the functions.php file of your theme put this code:
https://gist.github.com/aSeptik/9739808
NOTE
after installing the above scripts make sure to delete the browser cache before test.
tested with latest wordpress, jetpack and wp-postrating versions.
this will also work with multiple gallery in the same page.
does not need to put any extra [ratings] shortcode anyware.
the bounty for this answer is too low... ;)
FIX
Fixed bugs added some check and debug to consol.log...
You can use hook into the Jetpack Carousel on the server-side
(like to output your data, for example).
Then on the client-side, get your Javascript rating code to
load after the Jetpack+Carousel JS, and hook into them
(hook on the bindings, etc).
JetPack provides 2 JavaScript hooks:
1) jp_carousel.afterOpen
2)jp_carousel.beforeClose.
Action hook code example

CKEditor: Disable default linking of email ids

I am using CKEditor recent version. Whenever a user types his email ID an anchor link is created. Like abcd#example.com is created in the output. How do I disable this property in CKEditor configuration.
I tried config.forcePasteAsPlainText = true; and it didnt help in this particular case.
Auto Url Detection is an IE feature, and as of IE9 you can disable this.
Prior to IE9, it was not possible to specify IDM_AUTOURLDETECT_MODE from JavaScript, meaning that pages could not disable automatic hyperlinking in ContentEditable areas. A new command constant AutoUrlDetect is supported in IE9, allowing script to disable automatic hyperlinking as follows: document.execCommand("AutoUrlDetect", false, false)
You could try executing this call on the editor's document object.
You can also, before CKeditor creates the output (for example the moment the user clicks on the submit button) search for # in input and replace them with #

Joomla module or component to be render on a blank page

I have developed a Joomla module that does provides a form, processes its post data, does some calculations and displays the results.
The module includes a button to print the results. I'm currently using JavaScript to open a new window, paste the relevant HTML and open the print dialog.
Instead of JavaScript I would prefer to provide a separate URL for the print view and simply open that in a _blank target. This would make the application work better for people using screen readers or not having JavaScript available.
Is there any way that I can tell Joomla to not render the template along with my module? I was thinking that creating a component fixes that issue, but had to find that components are rendered into the template, too...
BTW: I have Joomla 1.5.22
To achieve what you want you have to add additional tmpl=component query string parameter to the request URL. This will disable template and module rendering.
Your URL will look something like this: index.php?option=com_xxx&view=xxx&tmpl=component
Since you are using Joomla 1.5 you can request index2.php?option=com_xxx&view=xxx and it will only render the component. Joomla 2.5 does not have index2.php so if you plan to migrate in future, don't use this option.
If you are using SEF then adding ?tmpl=component at the end on URL does the trick.
To go a step deeper... in your template directory you have component.php file, that is the file that's being loaded by tmpl param. You can copy component.php to my_component.php, do necessary changes and load your custom component template with index.php?option=com_xxx&view=xxx&tmpl=my_component
The joomla way of doing it would be to set your output to "raw", see this tut:
http://www.katcode.com/displaying-raw-output-in-joomla-by-setting-format-in-the-component/

Resources