Auto cut-tagging achieved
Well, that was easy. I've been fiddling a bit with making my friends view block quizlets, which involves a bunch of string parsing that the LJ style language does not already include, and
laurion commented that it would be handy to chop entries over a certain length. I realized that I could do that by adding two lines to the basic layout, so now my friends page auto-cuts after 1000 characters. (That number is actually rather smaller than I want for regular use, but works well for demonstration purposes.)
Take that, overlong uncut entries.
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
Take that, overlong uncut entries.
no subject
Now, can you explain it so the rest of us understand?
no subject
$e is the Entry object, which contains all the metadata as well as the raw text. $content will later be passed to another function for pretty formatting, and normally would just be a straight dump of the user's input, $e.text, but I'm intercepting it. If the text is longer than my cutoff, I take just that much and append a link to the full entry; otherwise, it gets passed along normally.
Pretty basic change, and there's a lot I could do to make it cleaner (starting with abstracting out the magic number). But, hey, that stuff takes longer than 30 seconds.
no subject
no subject
In S2 you have the option to create a pile of different 'layers', but the basic one you want is a top-level layout layer. I copied and pasted the code of mine from the stock Tabular Indent layer, and then tweaked here and there, because I didn't have sweeping changes to enact. It is in this layer that I have added the new code.