Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Functionality to automatically insert <readmore> tags into long posts?

by sundialsvc4 (Abbot)
on Jul 23, 2013 at 14:50 UTC ( #1045886=note: print w/ replies, xml ) Need Help??


in reply to Functionality to automatically insert <readmore> tags into long posts?

Some forum-engines handle this sort of thing automagically on-display.   If the post is longer than a certain size, it stops at a certain point with a clickable tag ... which reveals the rest by means of a little JavaScript snippet that un-hides the HTML section.   It would be easy to do.   But is it actually worth doing?   I’m not sure.   I guess I’m too comfortable now with this ol’ familiar dog ... and reluctant to do things with other people’s content, as they say, “automagically.”


Comment on Re: Functionality to automatically insert <readmore> tags into long posts?
Re^2: Functionality to automatically insert <readmore> tags into long posts?
by LanX (Canon) on Jul 23, 2013 at 15:02 UTC
    I already thought of this, but it's only possible with linear text without nested html structures.

    For instance you can't easily break a code-section just somewhere in the middle.

    In consequence we are back to the original problem, namely to parse the doc-tree of the post and to decide where to automagically put readmore-tags around.

    I thinks it's easier just to count the lines and to force the poster to include <readmore> tags.

    OTOH since I'm not motivated to code it, I don't ask others to do it.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      I already thought of this, but it's only possible with linear text without nested html structures.

      Huh? I think you're over thinking this, its 100% javascript

      $("tr[@class='reply-body pmnote-708738']/td[@class='reply-body']").hei +ght(200);

      Add a show/hide from one of these Re: Collapsible comments, toggleDisplay

        You're hidding the complete post.

        The idea of the readmore-mechanism is to have a preview of the entry ("readsome lines") before the rest is hidden with "readmore".

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2014-09-22 20:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (200 votes), past polls