?

Log in

No account? Create an account

Previous Entry | Next Entry

Here's hoping I'm making this clear enough to get proper help. :)

One of my journals - calscripts - is a story archive. When someone clicks on a tag, I would like the entries under that tag to be displayed from oldest to newest, because obviously, chapter 1 will be older than chapter 10! It needs to be at the top!

I looked through the community but all I could find were entries for the initial tag display, and nothing for modifying what comes after you click a tag, eg:

http://calscripts.livejournal.com/tag/entry:calscript:ffc

If I could get some direction as to where to look, even that would be helpful. I noticed that when you go to customize an expressive theme, you can set the day and archive pages to show the least recent first, but you can't do that with the tags.

Edit: To clarify, I need some sort of test to know whether a page being displayed is a tag-filtered page, so I can only reverse entries on those pages (since they could as "recent" pages).

Comments

( 3 comments — Leave a comment )
av8rmike
Apr. 3rd, 2008 06:43 pm (UTC)
Well, it's possible, sort of. "Reversing order of entries" is such a frequently asked question in Support that it's covered in FAQ #248 and has its own tag in s2howto. It's easy enough to modify the RecentPage::print_body() function to reverse entry display on all RecentPages, which includes tag-filtered pages. Unfortunately it also affects the main journal page and the friends page. It will also affect only the posts displayed on the current page, not the actual navigation.

In other words, say you had a story with 10 chapters and only displayed 5 posts per page. In the "normal" order, chapters will display 10-6 on one page and 5-1 on the second. If you apply the "reversing entry order" code, they will display 6-10 on the first page and 1-5 on the second. Make sense?

EDIT: Slight correction: I figured out how to modify the code to reverse only entries on tag-filtered pages instead of all RecentPages, if you're interested.

Edited at 2008-04-03 07:09 pm (UTC)
calophi
Apr. 3rd, 2008 07:17 pm (UTC)
Yes I'm VERY interested!

Edit: That's actually what I was going for, some kind of "test" for a tag filter page, since I can't seem to find one anywhere.

Edited at 2008-04-03 07:30 pm (UTC)
av8rmike
Apr. 5th, 2008 08:32 pm (UTC)
Sorry to have kept you waiting so long; I've been out of commission for a few days. The highlighted part is the part I added/changed, thanks to something afuna developed in s2flexisquares. Let me know if you have any problems.
function RecentPage::print_body() {
    var string skiplinks = "";
    var string back_url  = $.nav.backward_url;
    var string fore_url  = $.nav.forward_url;
    if($back_url != "" or $fore_url != "") {
        var string url  = "";
        var string text = "";

        if($back_url != "") {
            $url  = $back_url;
            $text = get_plural_phrase($.nav.backward_count, "text_skiplinks_back");
            $skiplinks = $skiplinks + """<a class="prev" href="$url">$text</a>""";
        }

        if($back_url != "" and $fore_url != "") {
            $skiplinks = $skiplinks + " | ";
        }

        if($fore_url != "") {
            $url  = $fore_url;
            $text = get_plural_phrase($.nav.forward_count, "text_skiplinks_forward");
            $skiplinks = $skiplinks + """<a class="next" href="$url">$text</a>""";
        }
    }

    if($skiplinks != "") {
        println """<div class="stream-header">""";
        println """<p class="prevnext">""";
        println $skiplinks;
        println "</p>";
        println "</div>";
    }

    if (not($this isa FriendsPage)) {
        print_sticky();
    }

    var Entry[] entries = $.entries;
    var bool tag_view = $.data_link{"rss"}.url->contains("?tag");
    if ($tag_view){
        $entries = reverse $.entries;
    }
    foreach var Entry e ($entries) {
        $this->print_entry($e);
        if ($e->viewer_sees_ebox()) {
            """<div style="margin-top: 20px; margin-bottom: 30px;">""";
            $e->print_ebox();
            "</div>";
        }
    }

    if($skiplinks != "") {
        println """<div class="stream-footer">""";
        println """<p class="prevnext">""";
        println $skiplinks;
        print """ | <a href="#home">Back to Top</a>""";
        println "</p>";
        println "</div>";
    }
}
( 3 comments — Leave a comment )

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars