Text filter to only show first content page if current route is not that entity route

Created on 12 May 2023, about 1 year ago
Updated 22 June 2024, about 15 hours ago

Problem/Motivation

It would be really useful if there was a text filter that would just output the first page of content if the current route is not the route belonging to that entity.

Proposed resolution

Provide a text filter that removes all text after the page break if the current route is not the entity's route.

Remaining tasks

Build the thing.

User interface changes

New text filter.

API changes

n/a

Data model changes

n/a

✨ Feature request
Status

Needs review

Version

1.1

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @DamienMcKenna
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    WIP, I'm stuck because of #3360216.

  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    This works, though it takes a bit of finagling to make it work correctly due to #3360216.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    In order to make #3 work I had to manually modify the config file for the text format like this:

      filter_html:
        id: filter_html
        provider: filter
        status: true
        weight: -48
        settings:
          allowed_html: '<br> <p class="text-align-left text-align-center text-align-right text-align-justify"> <h2 class="text-align-left text-align-center text-align-right text-align-justify"> <h3 class="text-align-left text-align-center text-align-right text-align-justify"> <h4 class="text-align-left text-align-center text-align-right text-align-justify"> <h5 class="text-align-left text-align-center text-align-right text-align-justify"> <h6 class="text-align-left text-align-center text-align-right text-align-justify"> <strong> <em> <s> <sub> <sup> <blockquote> <a href data-entity-type data-entity-uuid data-entity-substitution> <ul> <ol reversed start> <li> <hr> <drupal-media data-entity-type data-entity-uuid alt data-caption data-align> <div class="page-break" style="page-break-after"> <span style="display">'
          filter_html_help: false
          filter_html_nofollow: false
    

    The new bits are the DIV and SPAN items at the end.

    It's worth noting that the plugin in #3 looks for <div class="page-break" rather than the full string provided by the Pagebreak plugin.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Now with the config file I forgot to add before. I also renamed the plugin to be more specific.

  • Status changed to Needs work about 15 hours ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Moving to the CKEditor 5 Plugin Pack module.

    The patch needs to be rerolled.

  • Status changed to Needs review about 15 hours ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Rerolled.

Production build 0.69.0 2024