CSS classes / Smarty Variables
This will contain items from http://www.s9y.org/forums/viewtopic.php?t=2463&highlight=.
- CSS Classes
- Smarty Variables
- $raw_data [mixed]
- $plugin_calendar_weeks [array], $plugin_calendar_dow [array], plugin_calendar_head [array]
- $is_form [bool], $category_image [string], $form_url [string], $categories [array]
- $plugindata [array], $pluginside [string]
- $leftSidebarElements [int], $rightSidebarElements [int]
- $content_message [string]
- $searchresult_tooShort [bool], $searchresult_error [bool], $searchresult_noEntries [bool], $searchresult_results [bool]
- $startpage [bool]
- $uriargs [array]
- $is_preview [bool]
- $preview [string]
- $commentform_action [string], $commentform_id [string], $commentform_name [string], $commentform_email [string], $commentform_url [string], $commentform_remember [string], $commentform_replyTo [array], $commentform_subscribe [string], $commentform_data [string], $is_commentform_showToolbar [bool], $is_allowSubscriptions [bool], $is_moderate_comments [bool], $commentform_entry [array]
- $comments [array]
- $metadata [array], $entries [array], $is_comments [bool], $last_modified [string], $self_url [string], $namespace_display_dat [string], $once_display_dat [string]
- $entry_id [int], $is_comment_added [bool], $comment_url [string], $comment_string [string], $is_showtrackbacks [bool], $comment_entryurl [string], $is_showcomments [bool], $is_comment_allowed [bool], $is_comment_notadded [bool], $is_comment_empty [bool]
- $view [string - available for 1.0-beta3 and above]
- $footer_prev_page [string], $footer_next_page [string] $footer_totalEntries [int], $footer_totalPages [int], $footer_currentPage [int], $footer_pageLink [string], $footer_info [string]
- $plugin_clean_page [bool], $comments_messagestack [array], $is_comment_added [bool], $is_comment_moderate [bool], $entries [array]
- $trackbacks [array]
- $head_charset [string], $head_version [string], $head_title [string], $head_subtitle [string], $head_link_stylesheet [string], $is_xhtml [bool], $serendipityVersion [string], $lang [string]
- $use_popups [bool], $is_embedded [bool], $is_raw_mode [bool]
- $entry_id [int], $is_single_entry [bool]
- $blogTitle [string], $blogSubTitle [string], $blogDescription [string]
- $serendipityHTTPPath [string], $serendipityBaseURL [string], $serendipityRewritePrefix [string], $serendipityIndexFile [string]
- $category [int], $category_info [array]
- $template [string]
- $dateRange [array]
- $template_option [array - available only for Serendipity 1.1 and above]
- Plugin Hooks
CSS Classes
.serendipity_entry
Contains the entry
.serendipity_title
Style for the title for each entry
.serendipity_date
Style for the date of each entry
.serendipity_commentsTitle
Style used for the "Trackback", "Comments" and "Add Comments" titles in the extended entry view
.serendipitySideBarTitle
Style for the Titles of the sidebar plugins
Smarty Variables
$raw_data [mixed]
If a theme with an old-style "layout.php" is used, this contains the output from that layout.php code.
Scope: *.tpl
$plugin_calendar_weeks [array], $plugin_calendar_dow [array], plugin_calendar_head [array]
Contains the calendar item data for displaying the sidebar calendar (associative arrays)
Scope: plugin_calendar.tpl
$is_form [bool], $category_image [string], $form_url [string], $categories [array]
Specific variables for displaying the category listing in the sidebar. $is_form indicates whether a <form> tag for selecting multiple categories shall be emitted.
$form_url contains the URL to the submission target of the form.
$category_image contains the image filename for the "XML" button.
$categories holds an associative array of the (nested) category listings.
Scope: plugin_categories.tpl
$plugindata [array], $pluginside [string]
$plugindata contains an associative array for the output of a sidebar plugin. The keys are 'side' (left/right), 'class' (CSS), 'title' (text), 'content' (HTML), 'id' (plugin ID).
Scope: sidebar.tpl
$leftSidebarElements [int], $rightSidebarElements [int]
Contains the amount of sidebar plugins for each side.
Scope: *.tpl
$content_message [string]
Holds some output about the specific error/notice messages from Serendipity (like number of searchresults, no entries found, etc.)
$searchresult_tooShort [bool], $searchresult_error [bool], $searchresult_noEntries [bool], $searchresult_results [bool]
Indicates whether the quicksearc returned errors/results/no entries
Scope: index.tpl, content.tpl
$startpage [bool]
If set, then serendipity currently displays the startpage on the frontend
Scope: *.tpl
$uriargs [array]
Contains a list of URI arguments passed to the current page
Scope: *.tpl
$is_preview [bool]
If set, the template is currently being called in "preview mode" from the backend
Scope: *.tpl
$preview [string]
Contains the entry preview (parsed 'entries.tpl')
Scope: preview_iframe.tpl
$commentform_action [string], $commentform_id [string], $commentform_name [string], $commentform_email [string], $commentform_url [string], $commentform_remember [string], $commentform_replyTo [array], $commentform_subscribe [string], $commentform_data [string], $is_commentform_showToolbar [bool], $is_allowSubscriptions [bool], $is_moderate_comments [bool], $commentform_entry [array]
Multiple variables used for representing the comment form.
$commentform_action contains the form URL to submit the data to.
$commentform_id contains the ID of the entry to display the form for.
$commentform_name, _email, ...: The specific entered data from the user. Drawn from POST or COOKIE.
$commentform_replyTo: Contains dropdown values for the threaded comment list so far
$is_commentform_showToolbar: Indicates if extended commentform options shall be displayed (admin purpose)
$is_allowSubscriptions: Whether the "mail notifications" option is available
$is_moderate_comments: Whether the current entry requires moderation
$commentform_entry: The associative entry data of the entry being commented on
Scope: commentform.tpl
$comments [array]
The list of (threaded) comments.
Scope: comments.tpl
$metadata [array], $entries [array], $is_comments [bool], $last_modified [string], $self_url [string], $namespace_display_dat [string], $once_display_dat [string]
Contains multiple values for displaying an RSS/ATOM feed.
$metadata is an associative array containing metadata for the current feed. Array keys: 'title' (feed title), 'description' (feed description), 'language' (feed language), 'additional_fields' (specific fields from the syndication plugin), 'link' (feed link), 'email' (admin email), 'fullFeed' (if the feed contains full texts), 'showMail' (whether emails are disclosed), 'version' (feed version).
$entries holds the associative array of entry data
$is_comments indicates whether this is a comment only feed
$last_modified contains the timestamp of last entry modification
$self_url contains the URL of the current feed
$namespace_display_dat contains additional XML namespaces for the feed as configured per plugins
Scope: feed*.tpl
$entry_id [int], $is_comment_added [bool], $comment_url [string], $comment_string [string], $is_showtrackbacks [bool], $comment_entryurl [string], $is_showcomments [bool], $is_comment_allowed [bool], $is_comment_notadded [bool], $is_comment_empty [bool]
Multiple values for showing the comments inside a popup window.
$entry_id contains the ID of the entry showing the comments
$comment_url contains the URL to submitting a comment to
$comment_entryurl contains the URL to the entry for which comments are shown
$comment_string returns a message after submitting a comment
$is_show_trackbacks indicates whether trackbacks shall be shown
$is_comment_added indicates if a comment has just been added.
$is_showcomments indicates if comments shall be displayed
$is_comment_allowed indicates if comments are allowed
$is_comment_notadded is set when a comment could not be added
$is_comment_empty is set when a comment was submitted with no text
Scope: commentpopup.tpl
$view [string - available for 1.0-beta3 and above]
Indicates the current "view" on the frontend. One of: "archives, entry, feed, admin, archive, plugin, categories, authors, search, css, start, 404"
Scope: *.tpl
$footer_prev_page [string], $footer_next_page [string] $footer_totalEntries [int], $footer_totalPages [int], $footer_currentPage [int], $footer_pageLink [string], $footer_info [string]
Specifies multiple variables for showing the pagination footer.
$footer_prev_page, $footer_next_page and $footer_pageLink contains links to the previous page, next page and the current page.
$footer_totalEntries holds the total number of entries available in the current display scope.
$footer_totalPages holds the total number of pages available in the current display scope.
$footer_currentPage holds the number of the currently viewed page
$footer_info contains a textual representation of which page you are currently viewing ("Page 1 of 5, totalling 20 entries")
Scope: entries.tpl
$plugin_clean_page [bool], $comments_messagestack [array], $is_comment_added [bool], $is_comment_moderate [bool], $entries [array]
Several variables for showing/parsing entries.
$plugin_clean_page indicates whether a plugin has taken over parsing entries.tpl, and not the usual entries listing is displayed.
$comments_messagestack holds an array of output messages when somebody submits a comment (like "comment was added", "comment was moderated" etc.).
$is_comment_added indicates whther somebody just submitted a comment.
$is_comment_moderate indicates if the current entry being displayed is moderated
$entries is one large, multi-dimensional array that holds all entries being displayed on the current page. Important key indices are:
title: The entry title
html_title: The unescaped entry title (no htmlspecialchars is applied here)
body: The entry body
extended: The extended entry
is_cached: Whether the current entry markup was cached
author: The author name of the entry
authorid: The authorid of the entry
email: Email address of the author of the entry
link: The URL to the current entry
commURL: The link to commenting on an entry
rdf_ident: RDF metadata unique id
link_rdf: RDF metadata URL
allow_comments: Whether comments are allowed to this specific entry
moderate_comments: Whether comments are moderated for this entry
viewmode: If comments of this entry are currently being viewed in LINEAR or THREADED mode
link_viewmode_threaded: Link to viewing comments in threaded view
link_viewmode_linear: Link to viewing comments in linear view
link_author: Link to viewing all entries for the author of the current entry
link_allow_comments: An admin link for allowing comments
link_deny_comments: An admin link for denying comments
link_popup_comments: URL to the popup window for comments to this entry
link_popup_trackbacks: URL to the popup window for trackbacks to this entry
link_edit: URL to the backend for editing an entry
link_trackback: Trackback-URL for this entry
categories: An array of all associated categories to this entry
has_extended: If an entry has an extended entry
is_extended: If the entry is currently being viewed completely
has_comments: Whether the entry has comments
label_comments: The text label of a comment (singular/plural)
has_trackbacks: Whether the entry has trackbacks
label_trackbacks: The text label of a trackback (singular/plural)
is_entry_owner: Indicates if the currently logged in user is the owner of this entry
plugin_display_dat: Plugin output for this entry
Scope: entries.tpl
$trackbacks [array]
Holds an array of trackbacks being displayed
Scope: trackbacks.tpl
$head_charset [string], $head_version [string], $head_title [string], $head_subtitle [string], $head_link_stylesheet [string], $is_xhtml [bool], $serendipityVersion [string], $lang [string]
Multiple variables defining the Serendipity version/language, blog title and link to Stylesheets. $head_title and $head_subtitle are set according to which action is currently performed on the frontend (category view, archive view etc.)
Scope: *.tpl
$use_popups [bool], $is_embedded [bool], $is_raw_mode [bool]
Indicates if popups are enabled on the blog, if the blog is embedded, and if the blog is using deprecated layout.php styling
Scope: *.tpl
$entry_id [int], $is_single_entry [bool]
If the frontend is currently displaying a single article, those variables hold the boolean state and entry id.
Scope: *.tpl
$blogTitle [string], $blogSubTitle [string], $blogDescription [string]
Holds the configured blog's title, subtitle and description as entered by the admin. Note that those variables will not be changed, unlike the $head_subtitle / $head_title variables!
Scope: *.tpl
$serendipityHTTPPath [string], $serendipityBaseURL [string], $serendipityRewritePrefix [string], $serendipityIndexFile [string]
Holds several URL strings for the blog
Scope: *.tpl
$category [int], $category_info [array]
$category holds the current ID of a category, if a category is being viewed. $category_info contains an associative array with the full category data ('category_name', 'parentid', 'category_description' etc.)
Scope: *.tpl
$template [string]
The name of the currently selected template
Scope: *.tpl
$dateRange [array]
Holds an array of two timestamps that restrict the date scope of entries being displayed (if set)
Scope: *.tpl
$template_option [array - available only for Serendipity 1.1 and above]
Holds configured template options that were set in the backend for templates supporting options (like colorsets, navigation links etc.)
Scope: *.tpl
Plugin Hooks
Most plugin hooks can be found in the Plugin API documentation, section "Event plugins".
frontend_header
Plugins can emit HTML which is put in the header.
frontend_footer
Plugins can emit HTML which is put in the footer.
This list gives a quick overview of the Classes and IDs used in the default theme. More can be generated from several plugins or by adjusting the .tpl files to your needs, but these are the ones you have to deal with in the first place.
The indentation represents the nesting of the HTML elements which use these classes/IDs. This should help you to use the inheritance of formats to your advantage when styling your own template.
- #serendipity_banner - Container for the top banner
- .homelink1 - Style for the first link in the banner
- .homelink2 - Style for the second link in the banner
- .homelink1 - Style for the first link in the banner
- #mainpane - Table containing the Sidebars and the main content
- #content - Table-Cell for the main content (the entries)
- .serendipity_Entry_date - Container for all entries of one day
- .serendipity_date - Style for the date display
- .serendipity_title - Style for the title for each entry
- .serendipity_entry - Container for the each entry
- .serendipity_entry_body - Container for the body of each entry
- .serendipity_entryFooter - Container for the footer of each entry
- .serendipity_entry_body - Container for the body of each entry
- .serendipity_date - Style for the date display
- .serendipity_Entry_date - Container for all entries of one day
- #serendipityRightSideBar - Container for the right Sidebar
- .serendipitySideBarItem - Container for each Sidebar item (normally a plugin)
- .serendipitySideBarTitle - Style for the title of each Sidebar item
- .serendipitySideBarContent - Style for the content of each Sidebar item
- .serendipitySideBarTitle - Style for the title of each Sidebar item
- .serendipitySideBarItem - Container for each Sidebar item (normally a plugin)
- #content - Table-Cell for the main content (the entries)
