The Bride of the First House (bride) wrote in lj_nifty,
The Bride of the First House
bride
lj_nifty

LJ-Cut Manipulation: Different Text in Different Views

timwi was playing with this and I thought it was rather nifty:

--------------------

You are reading this post from the Comment View. =)

You are reading this post from the Recent, Friends or Day View. =)

The above text will be different depending on where you're reading from: the Comment View or one of Recent, Friends or Day Views.

--------------------

Here's the HTML that does that:

... optional text in all views ...

<span style="display: none;"><lj-cut></span>
... text in the Comment View ...
<span style="display: none;"></lj-cut></span>

... optional text in all views ...

<span style="display: none;"><lj-cut>
<span style="display: none;"></lj-cut></span>
... text in the Recent, Friends and Day View ...
<span style="display: none;"><lj-cut></span></lj-cut></span>

... optional text in all views ...

[Update]

Okay, I bolded the different text and made it bigger so that it might be easier to see. Sorry for the confusion =)

Basically, if you go here, the third line will say "...Recent, Friends or Day View". If you go here instead, it will say "...Comment View".

By messing around with the LJ-Cut, you can potentially have completely different content on the two views. =)

[Update]

Oh, BTW, this works in Mozilla 1.5+, Opera 7.21+ and IE 5.5+; Safari has problems with it. I think it's the way the style="display: none;" is interpreted in the different browsers.

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 12 comments