every breath is a victory (moveablehistory) wrote in component_help,
every breath is a victory

  • Music:

modifying page summaries

I'm revamping my layout for the_lj_reboot, and so far all of the tutorials here have been very helpful, but I have come across a small problem: I'm using masterslacker's page summary tutorial, and I've managed to get my summary to look like this →

What I really want is this:

I've tried tables - which didn't work out so well, ack - and css things like float:left, etc, but to no avail. Any help would be greatly appreciated. :)

My code at present is as follows:

# Change the way RecentPage and FriendsPage summaries print. (FriendsPage inherits from RecentPage)
function RecentPage::lay_print_summary() {

   # print the header of the component and determine the size of the entries array
   var int size = size $.entries - 1;
   if ($size<0) { return; }

   # loop on the entries
   foreach var int pos (0..$size) {

      # Get the Entry and start the summary line
      var Entry e = $.entries[$pos];
      var string subject = ($e.subject!=""?$e->plain_subject():"<i>(no subject)</i>");

      # On the Friends page print: <poster_name> : <journal_name> : <security_icon> <subject> [+<comment_count>]
      if ($.view=="friends") {
         """$e.poster """;
         if ($e.journal.username!=$e.poster.username) { """: $e.journal : """; }
         if (defined $e.security_icon) { """$e.security_icon """; }
         """<a href="#$e.journal.username$e.itemid">$subject</a>""";
         if ($e.comments.count>0) { """ <a href="$e.comments.read_url">[+$e.comments.count]</a>"""; }

      # On the Recent page print: <date> <time> : <security_icon> <subject> [+<comment_count>]
      }else{ # recent page
         """$e.mood_icon<br/>"""; if (defined $e.security_icon) { """$e.security_icon """; }
         """<a href="#item$e.itemid">$subject</br></a>""";
         print $e.time->date_format()+" "+$e.time->time_format()+" :" ;
         if ($e.comments.count>0) { """ <a href="$e.comments.read_url">[+$e.comments.count]</a>"""; 

      # Close if..else loop and end the summary line

      # If it's not the last summary line, print a seperator bar
      if ($size!=$pos) { 
        <div class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></div>
        <div class="ltLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></div>

   # End the loop for entries

   # Print the component footer when done.

and my layerid is #7383625.


edit: solved. thank you!
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic