Truncate Stream Items > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

Truncate Stream Items

wersja drukowalna wersja Microsoft Word wersja HTML

When you use the search functionality (which encompasses search and streams), the ENTIRE content item text for each matching item is returned on the page. Which may be a stunningly large amount of text.

All of it. For each item. 

For both search results and stream results, after all that text has arrived and the page has fully loaded, a javascript controller is then applied.

For search results, the javascript finds the matching search term/s in the content, highlights those terms, and then provides a snippet of text before and after. All well and good and working as intended.

Streams, which is just search results based on non-term-based queries, the javascript applied is only truncating all of that text down to two or three lines of text. That's it.

It would be awfully wonderful if this truncation happened before dumping all this text to the page... I can't help much with search results without handling the finding-the-match-in-the-text stuff, but for STREAM results, I got this.

This lets you set a limit of words kicked out to the page per content item. From 50 to 500. Now, with a stunningly LESS amount of text getting pushed to the stream pages only to get truncated via javascript, stream pages will be MUCH faster.

Note that the truncate function on stream pages is still being applied. The advantage here is not loading the page with so much unnecessary text to be truncated.

Stream page items may truncate down to two OR three lines. Recommend leaving the word setting at 100 at least. Adjust as needed for font sizes, and so on, and such forth...

English language tested. Yell at me if this breaks Russian or whatever and I can take a look but don't expect instant results.

pon, 25 marzec 2019