May 24th, 2004

Dr. Malahatton
  • arique

(no subject)

Hi! Please take a look at my journal - arique

I've got a little problem. Hope, you'll be so kind to help me :)
Is there any way to get rid of those round corners?

Never mind, thanx 2 tjackson!
  • Current Music
    Alicia Keys - A Woman's Worth

Customising your Page Summaries

pyaari asked here how the RecentPage summary component could be altered to include a comment count next to each subject, so I decided to make this into a general post for everyone to see as this technique could be used to modify any of the other summary components as well.

Component uses the layout-defined function lay_print_summary() to print the summary component. If you would like to modify the way any of them print, you need to override the function on it's respective page. For example, to change the way the summary prints on the Recent Page, you need to override RecentPage::lay_print_summary() as shown in the code below. Because a FriendsPage is an extension of a RecentPage, overriding this function will affect both pages, so there are cases within the code to handle both page. Other page types are {DayPage, EntryPage, ReplyPage, MonthPage, YearPage}.

I wanted to show how to add more than just a comment count, so the code below formats the RecentPage entries in the form:
  <date> <time> : <security_icon> <subject> [+<comment_count]
and FriendsPage entries in the form:
  <poster_name> : <journal_name> : <security_icon> <subject> [+<comment_count>]

You can change the punctuation symbols by altering code in red, and you can change the ordering by swapping the lines around. If you do this, be careful of where you place whitespace between elements on each line. Note also that the link on the subject takes you to the entry on the current page, and the link on the comment count takes you to the entry page (the one with comments) on that person/community's journal.

Collapse )