🇨🇦Canada @nhoeller

Account created on 8 June 2009, over 15 years ago
#

Recent comments

🇨🇦Canada nhoeller

In Drupal 6, Preview showed both the trimmed and full text - Drupal 10 only shows the full text version.  This makes issues with where the text trims less obvious.  

I tested adding '<!--break-->'  in Source mode.  It works but only in Full HTML - I have not explored whether I can add the teaser to the Basic HTML filter.  I tested Restrict HTML - it showed teaser text because the <img> had been removed by the filter. 

I tried Ckeditor Drupalbreaks and CKEditor FakeObjects but they require CKEditor 4.  There are several issues about supporting CKEditor 5 but the status is unclear to me.

🇨🇦Canada nhoeller

In Drupal 6, Preview showed both the trimmed and full text - Drupal 10 only shows the full text version.  This makes issues with where the text trims less obvious.  

I tested adding '<!--break-->'  in Source mode.  It works but only in Full HTML - I have not explored whether I can add the teaser to the Basic HTML filter.  I tested Restrict HTML - it showed teaser text because the <img> had been removed by the filter. 

I tried Ckeditor Drupalbreaks and CKEditor FakeObjects but they require CKEditor 4.  There are several issues about supporting CKEditor 5 but the status is unclear to me.

🇨🇦Canada nhoeller

The code that generates the summary/teaser is in text.module.  Assuming no teaser break is included and the text is longer than the default (600 characters), it looks for various natural points where the text can be sliced.  The code:

  • creates an initial $summary up to the maximum number of characters (default is 600 characters)
  • reverses $summary so that it looks for 'natural' break points starting from the end of the trimmed text
  • the </p> tag has the highest priority, followed by <b /> and <b>, then punctuation marks

In the post where the image is in its own paragraph block, the length of the subsequent paragraph pushes its </p> tag is well past the default maximum length of the summary.  The code in text.module therefore trims everything past the 'image' </p>.  

If the text immediately follows the image definition, then text.module looks for </p>, <br />, and <br> (which it does not find in the first 600 characters), then punctuation symbols with the '.' having the highest priority.  The result is that 369 characters of the text block are included on the front page.  If the text after the paragraph had been short enough or the image definition did not take up 220 characters, I might not have run into this issue.  

I was surprised to see that the original '<!--break-->' teaser break was still supported.  I will test  https://www.drupal.org/project/ckeditor_drupalbreaks →  to make inserting it easier.  I also successfully tested the "Edit Summary" feature, adding the HMTL code for the image definition - I vaguely recall running into formatting issues in an earlier Drupal 10 release.

🇨🇦Canada nhoeller

I believe "Summary input" is enabled by default.  I disabled it and flushed all caches - the front page still showed the same results as before - one blog shows a teaser, the other does not.  What disabling the option did is suppress the ability to "(Edit summary)" in the blog post. 

After re-enabling "Summary input", I edited the second blog post, clicked on "(Edit summary)", and checked whether there was anything entered in that field - nothing there as far as I can tell.  I entered "type something", saved the post, and checked the front page - it does show "type something" but no image.  When I edited the blog post again and removed everything in "(Edit summary)", I am back to just the image showing on the front page without any text.

🇨🇦Canada nhoeller

Thanks for the fast response!  I recreated the issue on a test site that I built to diagnose another issue but ended up not needing it so there has been minimal customisation.  I installed and enabled:

  • Admin Toolbar/Extra Tools/Links Access Filter/Search
  • Chaos Tools
  • Simple Comment Notify
  • Blog, Pathauto, Token
  • Simple XML Sitemap/Search engines/Views
  • CAPTCHA, Image CAPTCHA, reCAPTCHA, reCAPTCHA v3

I had installed/enabled Smart Read More Link but just disabled it/cleared all caches and still see the same issue.

Below are screenshots of the Blog fields, primarily focusing on the Body field.  Let me know if I need to capture other information.  

For some reason, uploading the screenshots to another server and pointing to them using the Image tool shows the images when I edit the reply but not in preview so I will add the URLs as well.

Manage Fields and Body field settings (top part of edit showed Limited=1)

https://sinet.ca/drupal10test/blog-manage-fields.jpg

https://sinet.ca/drupal10test/blog-manage-fields-edit.jpg

Manage Form Display

https://sinet.ca/drupal10test/blog-manage-form-display.jpg

Manage Display/Default

https://sinet.ca/drupal10test/blog-manage-display-default.jpg

Manage Display/Teaser

https://sinet.ca/drupal10test/blog-manage-display-teaser.jpg

🇨🇦Canada nhoeller

I figured out the issue myself - I need to click on a Place block button to see all available blocks.

🇨🇦Canada nhoeller

Thanks for the fast response!  I went the CSS Editor route to keep things simple.  I will look into subthemes if I need to make more substantial changes.

I have not had to deal with CSS since 2009, ironically when I built a Drupal site and installed CSS Injector, something I promptly forgot.  

Production build 0.71.5 2024