Questions tagged [input-formats]
Drupal handles text using filters and input formats.
326
questions
0
votes
0
answers
25
views
CKEditor not respecting max image dimensions, alternatives?
Even though maximum image dimensions have been set, my users are still uploading massive images using CKEDITOR. this seems to be a known issue with no stable patch.
What are good alternatives to allow ...
1
vote
1
answer
47
views
How can I hide the Text Format selector when there is only one?
When a user has only a single text format option, just Filtered HTML for example, the selector is still shown even though there are no other options.
How can we remove this when there is only one ...
0
votes
1
answer
54
views
How do I programmatically disable a filter from a text format?
Suppose I have a text format like full_html and I have an enabled filter with ID my_filter_id.
How can I disable the filter programmatically from full_html.
I needed to put this in an update hook.
...
0
votes
0
answers
73
views
How can I search for existing nodes with "Text format" = "undefined"?
I've upgraded to Drupal 10 from an earlier release, which used the PHP module (not yet available for Drupal 10). Therefore, I had to uninstall the PHP module before upgrading, leaving the "Text ...
2
votes
0
answers
241
views
Token button missing from CKEditor 5 bar [closed]
I've recently started using CKEditor 5 on a new site.
I've enabled the Token and Token Filter modules, and checked the box on my Full Text format config screen to select 'Replaces global and entity ...
0
votes
0
answers
1k
views
How do I configure the styles dropdown in CKEditor 5?
I've got a fresh, standard install of Drupal 9.5-RC, and have added the Styles plugin to the Basic HTML text editor. The styles are set up like so:
p.test|Test P style
h2.test|Test H2 style
ul.test|...
0
votes
1
answer
1k
views
Getting the "processed" value of a formatted text field
I have a formatted text field on a content type that I'm using as the body of an email. If I load the node and print out the field I get:
>>> $n->field_thankyou_email_body->getValue()
=&...
0
votes
0
answers
326
views
How to bulk-change a text format?
I should paste much article content in Drupal in nodes.
The output data I paste has much HTML in it.
I need to paste the data without HTML at all so I thought about bulk-changing the content-type's ...
0
votes
1
answer
470
views
How do I test a CKEditor 5 text format field with Behat/Mink?
Drupal 10 is switching from CKEditor 4 to 5.
So, I installed the experimental CKEditor 5 module and am attempting to update my Behat tests to use CKEditor 5.
I am using an @javascript test in Behat on ...
-1
votes
1
answer
193
views
Missing text format: 4 - ckeditor issue
"Missing text format: 4." reported in log from anonymous user - I have Restricted HTML enabled for anonymous user
Drupal 9.3.8
This really fills the log - it seems a common issue for the ...
3
votes
1
answer
182
views
How do I use the markdown module to print the module README.md file?
I've created a README.md file in the custom module and would like to provide this as the help page in formatted HTML.
Raw text is being printed out, how do I get the HTML?
The module is drupal/...
0
votes
0
answers
89
views
Cannot enable PHP Filter module in a fresh Drupal 7 installation [duplicate]
In order to test my ISP (a2hosting.com), I created a simple website running Drupal version 7.74 (the latest from the 7 branch) on a subdomain. It is a standard installation, with no additional modules ...
-1
votes
1
answer
127
views
Why don't I see the colorbutton plugin in CKEditor?
I installed the Colorbutton module and its composer dependencies:
"drupal/colorbutton": "^1",
"drupal-ckeditor-libraries-group/colorbutton": "^4.14",
"...
2
votes
1
answer
404
views
How do I test a CKEditor 4 text format field with Behat/Mink?
I am using an @javascript test in Behat on CircleCI to check my Drupal 8 site.
When I use the standard I fill in "my field" with "value" step, it works for fields with the plain ...
0
votes
2
answers
101
views
I can't change permissions for text filters
I performed a pretty massive 50,000+ node migration a few weeks ago (from Drupal 7.70 to Drupal 8.9), and just noticed today that some of the Text Filters aren't visible in content creation pages (in ...
1
vote
1
answer
576
views
How can I fix a migration input format mess?
I did a migration from Drupal 6 to Drupal 8 and now I have two Full HTML, two Plain text, and all other individual for both versions of Drupal default text formats. Of course when I try to modify the ...
0
votes
0
answers
56
views
When/how are text format filters executed/applied?
I was experimenting in D8 with filters on text-formats to understand why i was not seeing CSS i had placed in a block.
Turning on and off Limit allowed HTML tags and correct faulty HTML and Correct ...
0
votes
0
answers
29
views
Set default/restrict text formats based on node type [duplicate]
In Drupal 8 (not D7) as noted here How do you limit a text input to only specific content types/fields.
For example, I create a new input type here: admin/config/content/formats
and call it "...
0
votes
1
answer
57
views
Make CKEDITOR Caption Required
Using Drupal 8 Ckeditor Core plugins -> drupalimage/drupalimagecaption how do I make an image caption required? The checkbox shown should always be clicked.
0
votes
1
answer
280
views
Drupal 8 - Add custom HTML with script to embed on a page as block
I need to add a custom form that has scripts and styles into a page as a block. Its dynamic, so I couldn't attach the scripts (#attached) as libraries. I just need to place the contents as is.
$...
0
votes
1
answer
150
views
How to allow HTML attribute with namespace using filter
One of the analytics providers requires all the links to have a specific attribute sc:linkname to track details. Drupal 8 filter works for linkname but not with sc: prefix. From https://html.spec....
0
votes
1
answer
475
views
How can I programmatically apply text formats?
I've created a custom text format I'm trying to apply to a field programmatically. As best I can tell, the format IS getting applied, but it is not stripping HTML tags like it is supposed to. The ...
2
votes
1
answer
751
views
Problem with text format and base64 inline images
I am using Drupal 8.6.13 text field with Full HTML text format for a field where we want to have content with inline base64 images (due to the synchronization with Gather Content).
Synchronization ...
0
votes
0
answers
78
views
Caching input filter results
I'm creating an input filter that is quite expensive, as it makes a call to a remote service as part of the processing of the output.
In Drupal 7, I'm pretty sure that the filtered output of an input ...
0
votes
1
answer
201
views
How do I include an affiliate script?
I am trying to add an affiliate script to my Drupal 7 website.
I am doing this in a custom block.
Specifically, I create a block, select the scripts text format in my WYSIWYG Editor, add the script ...
0
votes
1
answer
284
views
Cannot apply my custom styles to HTML tags in ckeditor
I'm using Drupal 8 and am trying to make ckeditor truly wysiwyg.
To that end I've successfully gotten ckeditor to use a custom stylesheet by adding a ckeditor_sylesheets key to my theme's info.yml ...
0
votes
1
answer
2k
views
Migrating input formats causes errors
I am trying to write custom migrations to migrate my Drupal 7 website to Drupal 8. I am currently using Drupal 8.6.7 and Drupal 7.61 for a copy of the production website.
So far I have set up the D8 ...
0
votes
0
answers
71
views
Bootstrap Responsive Wrappers module's Format field won't save using Drupal 8
I've setup a new style (Configuration / Content Authoring / Text Formats and Editors) in order to use the Bootstrap Responsive Wrappers module for video embeds.
I can apply the Format to text fields ...
4
votes
1
answer
314
views
Is it possible to make manual teaser breaks work with "Filtered HTML"?
This question is about Drupal 8.
Placing the following line inside a story node's body (I guess it also works for other content types) adds a manual teaser break:
<!--break-->
In Drupal 7, to ...
1
vote
1
answer
169
views
Does the summary area support input filters?
I have noticed that text filters placed in the summary area don't seem to work, that the raw text appears in the summary info when posted in Twitter, Facebook and the like.
Is that some inherent ...
0
votes
2
answers
1k
views
How to remove exposed filter if value is supplied in url?
We have a view page (path = /some-path/) that has an exposed filter called category. The detailed view setup is below. How would we hide the exposed filter if it is supplied from the url?
View setup:
...
0
votes
1
answer
148
views
Show content with a date after the current one on a view
I'm creating a calendar of events with Drupal 7 using views. At the moment the elements are shown in order of the date of each one (I have a date field where I put the date of the event). Now I need ...
-2
votes
1
answer
540
views
Highlight code for code presentation in articles [closed]
What is the solution to highlight PHP, JavaScript, or Java code in Drupal 8 articles?
I googled and found some information about Geshi for CKeditor. I installed it, but it converted < and > into ...
1
vote
0
answers
249
views
Properly export text format and editor settings
I'm trying to export the CKeditor settings and restricted_html settings but it's partially imported in the end.
I'm exporting the editor.editor.restricted_html.yml and the filter.format....
0
votes
1
answer
262
views
Adding an input filter to automatically replace text with HTML via a script
I am using Drupal 8 on Pantheon.
This is a website for an ebook. The ebook HTML was generated using a Perl script that automatically replaces text like this:
APPLE -> HTML including an apple image
...
1
vote
0
answers
40
views
Text Editor Rejecting certain words
I have been having an issue with drupal's text editor. I am making a custom block for FAQ section of my website but whenever I try to html code containing certain words inside such as 'from' etc. it ...
1
vote
0
answers
45
views
Entities being stripped from formatted field
I have a formatted text field using the basic_html filter, which is set up like this:
It is removing HTML unicode entities, in the format &#x<hex>; for example, the Euro symbol is €...
4
votes
2
answers
2k
views
I want to enable a disabled input format
I considered 'restricted HTML' as unnecessary and set it ‘disable’.
Because I thought it possible to re-enable.
However, I have not found a disabled format on UI.
Since there is no choice, I decided ...
0
votes
0
answers
28
views
Hook or any other extension place for changing the input format order in form display?
I want to change the order of the input formats (e.g. input format "rich text" comes before "text" in content type "article") in the node form field display. Could you recommend me a hook or any other ...
1
vote
0
answers
33
views
Is there a Drupal API function for retrieving text filter settings?
I've created a custom text filter, building on the filter_example.module. The filter lets the admin enter a setting for the filter (just like the "foo" filter in the example lets the admin set the ...
0
votes
1
answer
40
views
How to securise custom modules
I'm trying to understand how to securise my custom modules to avoid php insert into custom inputs and SQL injections in my db_query.
For inputs I'm using :
$form['custom'] = array(
'#type' =&...
0
votes
2
answers
1k
views
Rendering plain text instead of formatted data
In my custom module (in Drupal 8), I am using a form field (in a custom form) to use CKEDITOR with the following code which loads the editor fine.
$form['full_detail_text'] = array(
'#type' => '...
2
votes
0
answers
101
views
How can an Entity Reference filter against another field?
In Drupal 8, I have a content type for "Advances" that contains an Entity Reference field to "Technology". Each instance of an Advance should be of a certain type of Technology, which has Prerequisite ...
1
vote
1
answer
451
views
What is the difference between "Limit allowed HTML tags and correct faulty HTML" and "Correct faulty and chopped off HTML"?
In CKEditor Filter processes (/admin/config/content/formats/manage/filtered_html) there are filters.
If you use "Limit allowed HTML tags and correct faulty HTML" do you still also need the other one, ...
0
votes
1
answer
1k
views
What is wrong with my custom token to embed entities via token?
Edit: I guess it has something to do with the info part:
function mymodule_token_info() {
$info = array();
$info['types']['embed'] = array(
'name' => t('Embed'),
'description' => t('...
7
votes
3
answers
5k
views
How do i force a text format and hide the format selector in a formatted text field?
I Want to force a certain text format in a user profile text format field and hide the text format selector dropdown. How do i do it? This is for Drupal 8.
6
votes
5
answers
8k
views
How to use wysiwyg text editor (text_format) in a system configuration form
I couldn't find any documentation or examples about this. The implementation is very problematic. Do you a means to do this?
Problems
While trying to create a system settings form with text_format ...
0
votes
1
answer
47
views
PHP filtered page is cached
With a few years of Drupal 6 and 7 experience, I've happily made my first Drupal 8 installation. In my previous installations of Drupal I've used custom made PHP code that does a lookup in a personal ...
0
votes
1
answer
133
views
Increase Placeholder Length
I have a webform that has a textarea input. I am trying to update the placeholder text. It seems to have a limit of 128 chars. Is it possible to update this to allow for a longer placeholder?
0
votes
1
answer
492
views
Cannot load module uninstall page - says module does not exist
I accidentally deleted the Markdown filter module from the file system while it was still enabled. So I installed it again, via the GUI.
Now I cannot load the module uninstall page - it says "The ...