[Paid] Tutorial: How to turn any S2 Bloggish entry on a personal journal into a Sticky Post.

May 10, 2008 20:29


My past experiments show Sticky Post functionality for personal journals is limited in s2 Expressive and missing altogether in s2 Bloggish. Another user, watchmebe, was in a similar way recently. She wanted to make a Sticky Post for her personal journal's s2 Expressive style by simply removing the date on one entry that already works as a static content page for her. I thought the idea was brilliant, so I asked av8rmike, the person who helped her, if he would give me the Bloggish code. That question made my post in s2 Expressive off-topic, so I had to move it. Ultimately wrin answered it because av8rmike was too busy chasing the ladies (edit: but he denied this; later on he even said he wished that was the reason). So in this roundabout way I came to get the code to create a Sticky Post in Bloggish.

Instructions
  1. Important: This type of Sticky Post cannot be done in communities. Please see the related FAQ for more information.
  2. You'll need a post-dated entry to ensure your Sticky Post is the topmost entry on your journal. Pick a date well into the future so that things don't get out-of-order. If you normally sort your journal's order from earliest entry to latest, you'll need to do the opposite to ensure your Sticky Post stays on top across Archive, Tag, and Previous/Next views.
  3. You'll need a paid account with a custom theme layer enabled. If you haven't created a custom theme layer yet, see carriep63's instructions here and also check out her tips to ensure you add the layer in the correct order.
  4. You'll need to copy and paste the current code you're using in your theme layer into Notepad before you get started in case anything goes wrong.
  5. Ready? To remove the date for the Sticky Post we'll do a modification of the RecentPage::print_body function. The code is below. Copy and paste it in a line or two below any other code in your theme layer to keep things neat - and no, my theme layer is not neat, but each bit of code is separated by a line or two - in my mind that makes up for all the messiness :).


function RecentPage::print_body() { if ($.nav.backward_url != "" or $.nav.forward_url != "") { println """
"""; if ($.nav.backward_url != "") { println """ """ +get_plural_phrase($.nav.backward_count, "text_skiplinks_back")+ ""; } if ($.nav.backward_url != "" and $.nav.forward_url != "") { print " | "; } if ($.nav.forward_url != "") { println """ """ +get_plural_phrase ($.nav.forward_count, "text_skiplinks_forward")+ ""; } println """
"""; } foreach var Entry e ($.entries) { var Date checkdate = new Date; $checkdate.year = 2020; $checkdate.month = 12; $checkdate.day = 11; if ($*opt_datehead and $e.new_day and $checkdate-> compare($e.time) < 0) { print """""" +$e.time->date_format("med")+"""
"""; } # Print the entry $this->print_entry($e); if ($e->viewer_sees_ebox()) { """
"""; $e->print_ebox(); ""; } } if ($.nav.backward_url != "" or $.nav.forward_url != "") { println """
"""; if ($.nav.backward_url != "") { println """ """ +get_plural_phrase ($.nav.backward_count, "text_skiplinks_back")+""; } if ($.nav.backward_url != "" and $.nav.forward_url != "") { print " | "; } if ($.nav.forward_url != "") { println """ """ +get_plural_phrase ($.nav.forward_count, "text_skiplinks_forward")+""; } println """
"""; } }

Caveats: This code completely removes the date from the Sticky Post in the Default and Tag views, but in all other views the date will still show up next to the post time at the bottom of the entry. It will still appear on your Calendar as well.

Updated 1-17-09.

theme layers

Previous post Next post
Up