∑¦> (slyfoxesq) wrote in s2expressive,

Questions about Poe...

Hello! I decided yesterday to overhaul my layout, and i've got it looking mostly the way I want, but a couple things are still eluding me. I was up all night poking at it and my brain is fried; I did look through tags, but right now I'm suspecting the problem is me and not the code. Any help would be greatly appreciated.

1. Change the colour of the links list after each entry. For some reason I do not understand, this code is not working (nor is anything else I've tried):
.asset-meta-list a:link,
.asset-meta-list a:visited {
color : #26482A;

2. Get rid of the empty space at the bottom of the layout. There's a bunch of unnecessary padding there and I can't figure out where it's coded. Basically, go from this to this.

[ETA] 3. On my friends' page view, because there is no subtitle, the header jumps up and scalps the boys in my design. Any way to fix this/give the header a fixed height?

Also, not really a help question, but is it just me or has Poe disappeared from the list of layout options on the customize page? Hrm..

So I don't feel like a drain, there are several old posts here with people asking how to achieve the spiffy date format in Expressive. None of them were answered; I don't know if anyone's since figured it out and just never posted, but I figured it out for my layout so I thought I'd share in case anyone else wanted to use it. :) Be gentle; I'm self-taught and my code's always a little messy.

First I changed the way some of the date stuff prints (in a theme layer):

function lang_posted_by_date_and_time(EntryLite e, bool showposter, bool showdate, bool showtime) : string {
    var string posted = "";
    var string dayfmt_ent = "%%day%%";      # Day format to use for entries.
    var string datefmt_ent = $*lang_fmt_date_med;        # Date format to use for entries.
                             # Default is $*lang_fmt_date_med (%%mon%%. %%dayord%%, %%yyyy%%)
    var string timefmt_ent = "%%h%%:%%min%% %%a%%m";        # Time format to use for entries.
                             # Default is %%h%%:%%min%% %%A%%M
    var string datefmt_com = "med";        # Date format to use for comments.
                             # Default is $*lang_fmt_date_med (%%mon%%. %%dayord%%, %%yyyy%%)
    var string timefmt_com = "short";        # Date format to use for comments.
                             # Default is "short", which looks like entry time default with lowercase "am/pm".

    if ($showdate and $showtime) { # Show both on entries and comments, with "at" in entries
        if ($e.depth > 0) { # If $e is a comment
            $posted = $e->time_display($datefmt_com, $timefmt_com);
        } else {
            var string date_time = "%%day%%, " + $*lang_fmt_date_med + " at %%h%%:%%min%% %%a%%m";
            $posted = $e->time_display($date_time, "none");
    } else {
        if ($showdate) { # Only showing date
            $posted = $e->time_display($datefmt_ent, "none");
        } else { # Only showing time (date is already shown in subject)
            $posted = $e->time_display("none", $timefmt_ent);
    return $posted;

Then I changed the way the entry prints to put the subject and date in the same table, and arrange the date the way I wanted it (you can just assert the colours directly here, or I guess you could assign them classes and change the colours in your CSS). Note that this code also moves your user-icon to the right side of the entry, under the date. (The short version would be just using what's in red in place of the datetime stamp.)

function print_entry(Page p, EntryLite e, Color bgcolor, Color fgcolor, bool hide_text) {
# Moves the user-pic next to entry header
    var bool showposter = false;
    if (not $e.poster->equals($e.journal)) { $showposter = true; }

    var Comment c;
    var Entry en;
    if ($e isa Comment) {
        $c = $e as Comment;
    } else {
        $en = $e as Entry;

    var string id = "";
    if (defined $c) {
        $id = " id=\"asset-$e.journal.username-$c.talkid\"";
    } else {
        $id = " id=\"asset-$e.journal.username-$en.itemid\"";

    <div$id class="post-asset asset">
      <div class="asset-inner">
        <div class="asset-header">
          <div class="asset-header-inner">
           <div class="asset-header-content">
              <div class="asset-header-content-inner">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="43"><td align="left" valign="top">
                <span class="asset-name page-header2">""";

    if (defined $en) {
        if (defined $en.security_icon) {
            """<span class="lj-entry-securityicon">$en.security_icon</span> """;

    var string subject  = "";
    var string datetime = "";
    var string myday = "";
    var string mydate = "";
    var string mytime = "";

    if ($e.subject != "") {
        $subject  = striphtml($e.subject);
    } else {
        $subject  = $*text_nosubject;

    $datetime = lang_posted_by_date_and_time($e, $showposter, true, true);
    $myday = $e.time->date_format("%%day%%");
    $mydate = $e.time->date_format($*lang_fmt_date_med);
    $mytime = $e.time->date_format("%%h%%:%%min%% %%a%%m");

    """<a href="$e.permalink_url">$subject</a>
<td align="right">

<font style=\"font-size:22px; font-family:Georgia; color: #47714C; line-height:8px; letter-spacing:6px;\">$myday </font><br><font style=\"font-size:14px; color:#000000; font-family:Georgia; line-height:8px; letter-spacing:2px\">$mydate</font><br><font style=\"font-size:12px; color:#FFFFFF; font-family:Georgia;\">$mytime</font>

</td></table></div></div></div></div> <!-- end asset-header -->
        <div class="asset-content">
            <div class="asset-body">""";

# Print the user-pic inside of .asset-header but before .asset-header-content
    var bool showuserpic = $*opt_userpic_main;
    if ($p.view == "friends") {
        $showuserpic = $*opt_userpic_friends;
    if ($p.view == "entry") {
        $showuserpic = $*opt_userpic_entrypage;

    var string userpic = ($showuserpic and defined $e.userpic) ? ($e.userpic + "<br />") : "";
    if ($showuserpic) {
        if ($bgcolor) {
            """<span class="user-icon" style="border: 1px; padding: 2px; background-color: $bgcolor;">$userpic""";
        } else {
            """<span class="user-icon">$userpic""";

    var string posted = "";
    if ($p.view == "friends") {
        if (not $e.poster->equals($e.journal)) {
           $posted = $posted + colored_ljuser($e.poster, $bgcolor, $fgcolor) + "<br />";
        $posted = $posted + colored_ljuser($e.journal, $bgcolor, $fgcolor);
    } else {
        if (not $e.poster->equals($e.journal)) {
            $posted = $posted + $e.poster;
    print "$posted";

    if ($showuserpic) {
        print "</span>";


    if (defined $en) {

    $p->print_reply_container({"target" => "entrycomment", "class" => "quickreply"});


    """<div class="asset-footer"></div>\n</div>\n</div>\n""";
    if ($*entry_footer != "") {

        println safe $*entry_footer;

I'm sure there's a lot of redundancy there that someone more skilled in code can chop, but it works, so I'm happy. :)
Tags: entries:links:colors, entries:timestamp
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened