howto_user (howto_user) wrote in s2howto,

S2 View Types

In S2, all journal views are defined in one layout. Each view can be treated as an object, which contains functions and variables that can be used on that type of page. The "Page" itself is a umbrella over all the others, providing functions and variables that can be used on all views, with each view adding something specific to the general Page.

  • Page

    Page is the top class for S2 views. This means that all the other "views" stem from this one type of object. Page is the entry class for views: when you first write a layout, the function that prints the information is Page::print. All other views are "subclasses" of Page. All other "page" types will be able to use any functions and variables of the Page class. The functions and variables available to the Page class are described here. To specify the type of view you are currently looking at, each Page includes a variable, called "view" which defines what type of page is being viewed. This variable can be accessed by referring to the "view" variable attached to each page object. (This means that within any "Page" class or subclass, you can just call $.view.)

    • RecentPage - $.view = recent

      Child class of Page. Most recent entries page, formally known as the LASTN view in the previous style system. The RecentPage class includes some functions and variables which are specific to this page, such as the array of entries to be printed.

      • FriendsPage - $.view = friends

        Child class of RecentPage. This view is the friends view, which displays the aggregated entries of all your friends. The entries this view has contain more information (friends colors) and there is an additional title string that is set from the friends page title from their personal info. Other than this, there really isn't much of anything different between Friends and Recent pages.

    • YearPage - $.view = archive

      The YearPage is the former calendar view of S1. This type of view contains information about months and the number of posts made per day on each day. This view is the only view which does not contain any entry information, such as subjects or entry text.

    • MonthPage - $.view = month

      The Month Page has information on all the entries made within a specific month. This view type contains metadata on all these entries, although it does not contain entry text or user pictures. This view is generally used to generate a subject listing for a specific month.

    • DayPage - $.view = day

      This view will display all the entries of a single day. The entry information contained in this view is the same as in the RecentPage view, meaning it includes full entry text, subject, user pictures, etc. Entries in this view are sorted, by default, in chronological order, rather than the reverse chronological order used by the Friends Page and Recent Page.

    • EntryPage - $.view = entry

      A single entry and the comments attached to that entry. This view contains full entry information as well as information about all the comments that users have left. This view is the one that defines how actual entries look.

    • ReplyPage - $.view = reply

      A page to reply to a journal entry or comment. This page defines the way that your journal will react when you leave a comment or when you reply to another comment. It includes special functions to generate the reply form as well as information about how replies should be formatted.

    • TagsPage - $.view = tags

      TagsPage displays the list of all the tags that the viewer is allowed to see. It contains the information about tags, such as the security level and the number of times used.

Tags: * basic tutorials, * view types

Comments for this post were disabled by the author