The current work-around is to use the summary field. Expected behaviour would be to consider a manually inserted teaser break.

Thanks.

Comments

alexverb’s picture

I'll have to investigate this one because there are still some issues in core 7.x with the break comment for filtered html and text. See Regression: 'break' tag doesn't work with Filtered HTML.

Could you provide me with a use case for this feature? Because I don't want to put too much effort into this feature that isn't going to work anywayz for filtered html and text.

alexverb’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new3.93 KB

With this patch I've added the functionality you've requested. Now it's possible to use the breakpoint comment to cut off the text wherever you want. Even if the breakpoint is located after the set trim length. So it's possible to manually shorten or lengthen your text without counting the HTML.

Is it possible for you to do some testing on my patch before I commit?

lolandese’s picture

Could you provide me with a use case for this feature?

I recommend this module in combination with the Flickr module. AFAIK till today it is the only module that can exclude HTML from the teaser character count. The embedded HTML generated by the Flickr module is often placed at the beginning of the first paragraph.

I will test your patch asap (latest tomorrow).

Thanks.

lolandese’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new187.08 KB
new7.21 KB

Sorry about the belated reaction. Previously I made a mess wanting to test it together with the Flickr module (Flickr Filter) but that seems to have problems with the teaser even with core. I should test that module separately.

Continuing more cleanly:

Test URL:
https://simplytest.me/project/field_html_trim/7.x-1.x?patch[]=https://ww...

Steps after launch:

  1. Enable Autofloat and add it to the text filter Full HTML.
  2. On teaser view of the content type Article Enable HTML trim and Exclude HTML tags from trim count
  3. Create an article and copy / paste the attached test.txt.
  4. Put the text format on Full HTML, save and check the front page.

All looks as expected.

I have some inconsistency when combined with HTML on the number of characters (see screenshot). Obviously that is another issue.

Screenshot

  • lolandese authored 46ef3f4 on 7.x-1.x
    Issue #2294813 by alexverb, lolandese: Manual teaser break <!--break-->...
alexverb’s picture

Version: 7.x-1.x-dev » 7.x-1.2
Status: Reviewed & tested by the community » Fixed

This feature is added in 7.x-1.2. Thx for the testing lolandese. I'll see if I can find some time to investigate the inconsistency on character count when HTML is used. But feel free to open another issue if you find such a case that can be easily replicated.

alexverb’s picture

Also a note to lolandese, I found the culprit of the inconsistancy in character count and made a new issue for that one. I just have to figure out the correct way to set up the word pattern. Shouldn't take all too long. See related issue.

lolandese’s picture

str_word_count disregards alphanumeric and other characters

Maybe my test.txt with mostly numbers is a worst case scenario. Obviously it was just intended to easily check on the number of characters in the teaser.

Thanks for the latest improvements. I'm following the other issue with interest.

alexverb’s picture

Status: Fixed » Closed (fixed)

Fixed in 7.x-1.3