ckeditor in a Bolt 2.0.x - ckeditor

Can anyone explain how I configure and/or add plugins to the ckeditor in a Bolt 2.0.5 install ?
Bolt does a lot of mods to the standard creditor install, and while it used to be easy to add things, it seems in recent releases to have become a lot harder.

Not sure about plugins, but you can set some options. The Bolt 2 config.yml file contains this:
# There are several options for giving editors more options to insert images, video,
# etc in the Wysiwyg areas. But, as you give them more options, that means they also have
# more ways of breaking the preciously designed layout. By default the most 'dangerous'
# options are set to 'false'. If you choose to enable them for your editors, please
# instruct them thoroughly on their responsibility not to break the layout.
wysiwyg:
images: false
anchor: false
tables: true # default is false
fontcolor: false
align: true # Add 'align left', 'align right',etc.
subsuper: false # Add buttons for subscript and superscript, using <sub> and <sup>
embed: false # allows the user to insert embedded video's from Youtube,
You can see that I've changed the default for the 'tables' option, and it worked fine.

Related

Create a field in FlexForm / TCA / FormEngine (TYPO3) with multiple on / off options and several presets

I am referring to Flexform here, but the same applies for non-Flexform TCA fields.
I would like to create a field in a Flexform which will contain several options which can be set on / off. For this field it should be possible to define one or more "presets": If a preset button is clicked, all options in that preset are selected (and the others deselected).
Such as:
The idea is if you press on one of the buttons ("Default", "Contact", etc.) the settings will be preselected based on this preset.
TYPO3 already supplies a bunch of types for selecting several options, such as selectSingleBox, selectCheckBox or check. In the screenshot, selectCheckBox is used. But how to do the preset part?
I am wondering if something like this already exists. If not, how best to do it because what I researched is a bit hackish or does not yield a nice result.
I have a working solution:
I but am not really happy with it because:
I created a custom fieldControl which is displayed on the right. For this reason I use selectSingleBox, but I would rather use selectCheckBox, but this does not support fieldControl
I would actually prefer selectCheckBox and display the presets at the top next or below the "Toggle all" and "Revert selection" (as in the first screenshot). I don't think this is configurable in FormEngine this way, so I would have to (messily) extend the class and modify the HTML or modify this via JavaScript.
I guess you could use a "fieldInformation" to display it above the field but this is a bit ugly because you use an "informational" field for functionality. Also
HTML returned by fieldInformation is limited
I like how TCA / FormEngine works in a modular way so you can "plug in" various renderTypes and not make a complete mess of it.

Custom background in title-slide using quarto's reveal implementation

I'm using quarto's reveal.js implementation. I've been reading the official documentation page on customising themes and I'm relatively familiar with SCSS rules.
I've been able to create classes to slides and then customise them via SCSS rules. Regretfully, I haven't been able to add a custom background (either colour or, ideally, image background) to the first slide (#title-slide) covering the entire area, as I would do in other regular slides as described here.
Is there any way to add custom backgrounds to the first slide other than this hack consisting of leaving the presentation's attributes blank?
EDIT:
Not sure if that's the right approach, but I tried adding the background-image url in the yaml metadata and it works:
---
title: "My title"
background-image: "https://images.unsplash.com/flagged/photo-1580139624070-910f651c1b78?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80"
background-opacity: "0.45"
format:
revealjs:
theme: [default]
logo: images/logo_black.png
editor: visual
---
Regretfully, properties such as background-color and background-opacity don't work.
Just for the record, after #tarleb's comment pointing me to pandoc's documentation, I made it work by adding this on yaml's metada:
---
[...]
title-slide-attributes:
data-background-image: "/path/to/image"
data-background-size: contain
data-background-opacity: "number"
[...]
---
As can be seen, other attributes can be passed, as long as
they are indented under title-slide-attributes
they are prepended with data-

Rinohtype frontend for Sphinx: How to manipulate the PDF subtitle, which is 'Release' by default

I'm generating PDFs via the rinohtype extension of Sphinx (i.e. not via the LaTex extension!).
For the two bundled rinohtype templates 'book' and 'article', where the latter is the one I use, the subtitle of the title page always starts with 'Release' by default (and a release version string if one is provided in conf.py via release = '1.0' - this is commented out in my case).
I want to:
1a) either get rid of the complete subtitle, i.e. also 'Release' isn't printed on the PDF title page, or
1b) want to change 'Release' to some other String, 'Rev.' in my case;
2) also have the modification of 1a) and/or 1b) applied to the page headers after "front matter", where 'Release' is also the default string.
What I found so far is:
Here it is described for LaTex, how to hide 'Release' (the subtitle) on the front page. However, this doesnt work for rinohtype. No real surprise, but I gave it a try because rinohtype also interprets some latex settings...
How do I get rid of the "Release 1" in the Page Header of the Sphinx Latex Output?
I also digged into rinohtype stylesheets and I found a way to hide elements of the title page. The linked stylesheet example shows how to hide the date entry on the title page. However, I'm not sure if this is actually the easiest solution (i.e. changing/extending the stylesheet) and this does also not hide the 'Release' String in the following page headers - see my Question 2) above.
https://github.com/brechtm/rinohtype/blob/40a63c4e5ad7550f62b6860f1812cb67cafb9dc7/tests_regression/sphinx_minimal.rts
rinohtype currently does not support changing "Release" into something else at the moment. This might be added in the near future however; see issue #157. This should also affect the page headers/footers.
You can hide the Release subtitle by means of a style sheet, like you discovered. It is also possible to remove it from the page header by supplying a custom template configuration. You'll need to override the header text for the contents and back matter page templates:
[contents_right_page]
header_text = '\t\t{DOCUMENT_TITLE}'
[contents_left_page]
header_text = '{DOCUMENT_TITLE}'
[back_matter_right_page]
header_text = '\t\t{DOCUMENT_TITLE}'
[back_matter_left_page]
header_text = '{DOCUMENT_TITLE}'

CKEditor Stripping Out Some of Our CSS classes

We are having a problem with CKEditor (ver 4.1.1.5) stripping out some of our css classes when we are editing in the FULL HTML mode using SOURCE. From looking at some of the other questions posed on this, the Advanced Content Filter is the place we should be going. And, if I read this correctly, we need to edit the config.js file to add: CKEDITOR.config.allowedContent=true;
Am I going in the right direction? I want the WYSIWYG to still work for people with no html experience. However, when we go into source, I want all classes to remain and not be stripped out, no matter what.
You are partially right:
Yes, Advanced Content Filter (ACF) is the mechanism responsible for this.
But no, setting config.allowedContent to true is not a correct solution.
In short, ACF is a useful mechanism that lets you easily control the content that your users add to your site with CKEditor. Instead of disabling it, however, you should extend the filter configuration to accept whatever additional elements, classes, styles, attributes you want to allow.
In your case, if you want to additionally allow all classes for all elements, use this in your editor configuration:
config.extraAllowedContent = '*(*)';
Read more about ACF here:
Content Filtering (ACF) - introduction
Demo of Automatic Mode and Custom Mode
Advanced Content Filter - more advanced
Allowed Content Rules - syntax for ACF rules

Augmenting config.allowedContent instead of overriding default value

The section entitled Advanced Content Filter guide in the CKEditor docs talks about how to set values for config.allowedContent. The documentation states that you can override the default value. No mention is made of how to obtain the default value and augment it.
For example, I want to allow script tags in addition to the default tags supported, as enhanced by any installed plugins. If I inspect config.allowedContent in the browser in the area where I set CKEditor config properties, I see that allowedContent is undefined. That tells m the default behavior is triggered by the value undefined, which is unfortunate.
How can this be done? I can think of the following approaches:
1) Somehow list the value of allowedContent on the console after initialization is complete. Not sure how to do that. Hard-code that value, plus script in the config section of my code. This is not the way I'd like to go forward.
2) Write a little plugin that merely adds script to allowedContent. Not sure what that would look like. This is a viable way forward.
3) Any other ideas?
I suppose that editor.config.extraAllowedContent is a remedy to your problem.
Note that CKEditor secures all <script> tags in your contents so included JavaScript is not executed (avoiding XSS). Anyway, for debugging purposes, allowedContent rules are stored in editor.filter.allowedContent during editor's lifetime.

Resources