Date: 2013-02-04 06:10 pm (UTC)
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (0)
Yep you could do all three at once. Ok so when you want to edit layers the first part is finding the right bit: this is usually something called a function or something starting with the word 'set' which is called a property. To do this you open the layer all the other layers depend on. It's called Core2 and you can find it at http://www.dreamwidth.org/customize/advanced/layersource?id=550&fmt=html.

A simple search for 'posting in' will lead you to:

property string text_posting_in {
des = "Text when user is posting in a community";
example = " posting in ";
}


and later this:

set text_posting_in = " posting in ";

What you wanna do for #2 and blank out this bit by changing it to this:

set text_posting_in = "";

Pretty easy so far, right? To do this you need to create a custom theme layer at http://www.dreamwidth.org/customize/advanced/layers but I think you already have one, correct? In this case, you only to add the line I mentioned above.

#1 and #3 are a bit more complicated. To find the bit you need to edit search for the more precise CSS class: entry-poster. At some point you'll find this bit:

# Prints the name of the account which posted the entry
function Entry::print_poster {
    var Page p = get_page();
    var string emptyclass = ((($p isa RecentPage and not $p isa FriendsPage) or $p isa MonthPage or $p isa DayPage) and $p.journal.journal_type != "C") ? "empty" : "";
    print safe "<span class=\"poster entry-poster $emptyclass\">";
    if ($p isa FriendsPage or $p isa EntryPage or $p isa ReplyPage) {
        $this.poster->print();
        if (not $this.poster->equals($this.journal)) {
            print $*text_posting_in;
            $this.journal->print();
        }
    }
    else {
        if (not $this.poster->equals($this.journal)) {
          $this.poster->print();
        }
    }
    print safe "</span>";
}


Now it's just a matter of reading the code. You can see where the SPANs are. You can guess that $this.poster->print(); prints the poster name whereas $this.journal->print(); prints the journal name. You can also see your by-now-familiar text_posting_in property (hmm seems you could have done all three here then!).

Now how to change it?

$this.journal->print(); is within an if thingie with brackets so to move it before $this.poster->print(); you have to move the whole thing like this:

# Prints the name of the account which posted the entry
function Entry::print_poster {
    var Page p = get_page();
    var string emptyclass = ((($p isa RecentPage and not $p isa FriendsPage) or $p isa MonthPage or $p isa DayPage) and $p.journal.journal_type != "C") ? "empty" : "";
    print safe "<span class=\"poster entry-poster $emptyclass\">";
    if ($p isa FriendsPage or $p isa EntryPage or $p isa ReplyPage) {
        if (not $this.poster->equals($this.journal)) {
            print $*text_posting_in;
            $this.journal->print();
        }
        $this.poster->print();

    }
    else {
        if (not $this.poster->equals($this.journal)) {
          $this.poster->print();
        }
    }
    print safe "</span>";
}


This takes care of #1.

You can also remove print $*text_posting_in;
This takes care of #2 (and you don't need the set line from before then).

Now #3 is a bit trickier because all of the conditional (if) statements. You gotta make sure that the SPANs are only printed if the element exists (there isn't always a community name or even a poster name) and that they're closed in the right place or you'll mess up your whole layout. I think it gives you this:

# Prints the name of the account which posted the entry
function Entry::print_poster {
    var Page p = get_page();
    var string emptyclass = ((($p isa RecentPage and not $p isa FriendsPage) or $p isa MonthPage or $p isa DayPage) and $p.journal.journal_type != "C") ? "empty" : "";

    if ($p isa FriendsPage or $p isa EntryPage or $p isa ReplyPage) {
        if (not $this.poster->equals($this.journal)) {
            print safe "<span class=\"poster\">";
            $this.journal->print();
            print safe "</span>";
        }
        print safe "<span class=\"entry-poster $emptyclass\">";
        $this.poster->print();
        print safe "</span>";
    }
    else {
        if (not $this.poster->equals($this.journal)) {
            print safe "<span class=\"entry-poster $emptyclass\">";
            $this.poster->print();
            print safe "</span>";
        }
    }
}


It might not be necessary to close the span both times but I'd rather do it that way to be on the safe side.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

Dreamwidth style system discussion

April 2025

S M T W T F S
  12345
6 78910 1112
13 141516171819
2021 2223242526
27282930   

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 9th, 2025 09:34 am
Powered by Dreamwidth Studios