Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@laceysanderson
Copy link
Member

@laceysanderson laceysanderson commented Apr 27, 2024

Tripal 4 Core Dev Task

Issue #1852

Tripal Version: 4

Description

There are a number of Chado fields that provide a textarea in the widget. However, none of these have text filtering enabled and thus curators do not see the editing toolbar on these fields... This is a usability concern -especially for long description fields- as it makes it very difficult for formatted text to be entered.

This PR alters the Tripal Text Field Widget + Formatter to support a configurable filter format. Choosing a filter format that the Wysiwyg toolbar is configured for, enables the toolbar on that field :-)

Testing?

  1. Checkout this branch on an existing Tripal site or in a docker container.
  2. Ensure that you can still create an organism or any other content type with text fields without first going to the page structure form display settings. You should already see the Wysiwyg toolbar as it will use the default "Basic HTML" format.
  3. Go to Page Structure > Organism > Manage Form Display and configure the Description field widget to use a filter format of "Full HTML". This will allow HTML to entered and rendered in the field without filtering.
  4. Now go back to your organism and edit it. Confirm you now see the Wysiwyg toolbar and that you can use it to include formatted text :-) Confirm you can save the content without error. Confirm that it is rendered as expected on the page.
Screenshot 2024-04-27 at 3 14 23 PM

@laceysanderson laceysanderson added Tripal 4 Group 1 - Tripal Content Types | Terms | Fields Any issue relating to Tripal Content including types, terms, and fields. labels Apr 27, 2024
@laceysanderson laceysanderson self-assigned this Apr 27, 2024
@laceysanderson laceysanderson marked this pull request as ready for review April 27, 2024 21:28
Copy link
Contributor

@dsenalik dsenalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a docker on this branch, php 8.3 Drupal 10.2

  • Tested creating a project, saw the wysiwyg toolbar by default
    2024-04-27_project-basic-html

  • Tested creating an organism, also saw the toolbar by default

  • Changed to FULL HTML and entered <h2> and <i> tags and they rendered correctly
    2024-04-27_fullhtml

  • Tested Restricted HTML. No toolbar is displayed and only some tags can be used. I tested h2 i strong em. The i tag is filtered out.

2024-04-restricted

  • Testing the same with plain, no tags are interpreted (as expected)
    2024-04-plain

Co-authored-by: Douglas Senalik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Group 1 - Tripal Content Types | Terms | Fields Any issue relating to Tripal Content including types, terms, and fields.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chado Fields using the textarea do not support Wysiwyg / Editor toolbar

2 participants