Page Index Toggle Pages: 1 Print
An Explanation of Template Tags (Read 6736 times)
Curtiss Grymala
Ex Member


An Explanation of Template Tags
Jan 17th, 2009 at 3:23pm
Print Post  
YaBB 2.x uses a total of 7 files to build and style a template. Those files are listed below.

The first six files are located in their own subdirectory within /cgi-bin/yabb2/Templates/. For instance, the default template files are found within /cgi-bin/yabb2/Templates/default.
These files are all editable by visiting the Admin Center and clicking on "Templates" in the navigation menu.

The last file listed below; the CSS file; is located within /public_html/yabbfiles/Templates/Forum and should be named the same thing as the subdirectory in which you saved your template files. For instance, the CSS file that controls the default template that comes with YaBB is located at /public_html/yabbfiles/Templates/Forum/default.css.
The CSS file is editable by visiting the Admin Center and clicking on "Style Sheet" in the navigation menu.
  • {templatename}.html - This file should be named the same as the directory in which it resides. This should be a somewhat descriptive name that lets the administrators (and any other super users that have the ability to modify templates) which template they are modifying. YaBB 2.2 and up comes with two standard templates installed. They are "default" and "yabb21".
    This HTML file is used to build the main look of your forums. It will be used as a "wrapper" for all of the pages in your forums. This is the best place to include any header and footer information, as well as any other items that should show up on all pages.
  • BoardIndex.template - This is the file used to build the BoardIndex (or front page) of your forum.
  • MessageIndex.template - This is the file used to build the MessageIndex (the main page of each board on your forums) that shows the list of posts within that board.
  • Display.template - This is the file used to build the actual message display page for each post on your board.
  • HelpCentre.template - This is the file used to build the Help pages within your forums.
  • MyCenter.template - This is the file used to build each user's profile page within the forums.
  • {templatename}.css - This is the style sheet that determines what fonts, colors, sizes, etc. are used throughout the forums.

Below, you will find a complete reference to all of the variables used within those template files and what those variables actually do.

Each "reply" below is related to one of the files mentioned above, and will include a copy of the default template file included in the most recent stable YaBB package for reference.

All variables marked with a red asterisk (*) are variables that can be (and sometimes are) used throughout your various template files. These particular variables are useful for many different reasons in all of the template files.

Note: At this time, this reference is under construction, so only some of the information is included. However, as time goes on, we will be working to fill in all of the information, and to keep it current with the most recent stable release of YaBB.
« Last Edit: Jan 27th, 2009 at 1:51pm by »  
Back to top
 
IP Logged
 
Curtiss Grymala
Ex Member


{templatename}.html - A template tag reference
Reply #1 - Jan 17th, 2009 at 3:28pm
Print Post  
{templatename}.html

This post includes a complete reference to the template variables used within the {templatename}.html file.

A Note About This File
Your forums will not work if the {yabb copyright} tag is not included in this file. The only way to get around that is to purchase a license from the YaBB Team.

If you find that your forums stop working suddenly after you finish editing or creating a template, the first thing you should check is to ensure that the {yabb copyright} tag is included somewhere in the body of your {templatename}.html file.

Template Tags

Head Section (the area of the template that is contained within the <head> section - nothing here is actually displayed on the page, as it's all meta information telling the browser how to interpret the page)
  • {yabb title}* - The page title that should be displayed in the title bar of your browser - This variable begins with the name of your YaBB installation. Whenever you are viewing a page other than the board index, the name of the page you are viewing is appended to the title. This variable can be used throughout your templates.
  • {yabb charset} - The character set that your browser should use to display the page. If you don't know what that means, don't mess with this variable, as it can cause much of the text on your page to display incorrectly if you change this to something incompatible. This variable has no use outside of the head section of your {templatename}.html file.
  • {yabb style} - The HTML code needed to include your CSS style sheet in the template - If you've developed your own style sheet in place of the template's style sheet, you should replace this variable with your own style sheet link. This variable has no use outside of your {templatename}.html file.
  • {yabb html_root}* - The URL that leads to your yabbfiles folder within the public_html area of your server. This variable can be used throughout your templates to access files within your yabbfiles folder. This variable is equal to the value you set in Admin Center -> Path Settings -> HTML URL.
  • {yabb javascript} - This is the full block of code necessary to include all of the javascript that controls various functions and features in YaBB. This should not be removed from the template. This variable has no use outside of your {templatename}.html file.

Body Section (the area of your template contained within the <body> tags. This is all of the information that actually shows up in the browser when a page of your forums is viewed)
  • {yabb time} - Displays the current date and time as configured in your forum settings and the user's control panel.
  • {yabb langChooser} - Displays the language selection form for guest visitors, if enabled in the Admin Center.
  • {yabb uname} - Displays a salutation ("Good Morning", "Good Afternoon", etc.) and the current user's display name.
  • {yabb im} - Displays information about the current user's private messages, including the total number of messages in the inbox (with a link to that inbox) and the number of "new" messages.
  • {yabb admin_alert} - Displays any important messages that need to be broadcast to administrative users, such as information about users that have registered but have not been verified.
  • {yabb images}* - The URL to the image directory for the current template (found within the public_html version of your Templates folder). This variable can be used throughout your templates to access images associated with the current template.
  • {yabb news} - Displays the forum news, as configured in Admin Center -> Forum News
  • {yabb tabmenu} - Displays the "tab menu", which includes links to "Home", "Help", "Search" and more.
  • {yabb tabadd} - Displays the buttons that administrative users can use to edit the "tab menu".
  • {yabb rss} - Displays the link button that allows users to view/subscribe to the RSS feed from your forums.
  • {yabb searchbox} - Displays the "quick search" form.
  • {yabb addtab} - Contains the necessary code to allow administrative users to add, edit, remove and reorder tabs on the "tab menu". This does not show up anywhere on the boards unless the administrative user has clicked one of the buttons shown by the "yabb tabadd" tag.
  • {yabb boardlink} - A link to the main page of your forums.
  • {yabb navigation} - A "breadcrumb" trail leading to the page currently being viewed.
  • {yabb main} - This is the variable that holds all of the information to be displayed in the main section of the page. The value of this variable is set by combining the code found in your various other template files, along with all of the variables contained within those files. For instance, if you are viewing the board index (the main page of your forums), the yabb main variable will contain all of the information set through your BoardIndex.template file.
  • {yabb forumjump} - Displays the "jump" menu that allows users to quickly move to various places in your forums.
  • {yabb navback} - Displays the links that allow users to go back to various places they've already been (the board index, the top of the page, the index for the board they are currently viewing, etc.).
  • {yabb copyright} - Displays the YaBB Copyright information. Your forums will not work without this tag, unless you have purchased a copyright removal license from the YaBB team.
  • {yabb freespace} - Displays the amount of free space currently available on the Web server (if enabled).
  • {yabb debug} - Displays important debug information, if enabled in the Admin Center.


A copy of the "default.html" file that is included with the YaBB 2.3.1 package is attached for reference.

The file here has been renamed with a txt file extension. In order to use it, you will need to remove the txt file extension and replace it with an HTML file extension.
« Last Edit: Jan 27th, 2009 at 2:49pm by »  

default.txt ( 4 KB | 8 Downloads )
Back to top
 
IP Logged
 
Curtiss Grymala
Ex Member


BoardIndex.template - A template tag reference
Reply #2 - Jan 17th, 2009 at 3:40pm
Print Post  
BoardIndex.template

This post includes a complete reference to the template variables used within the BoardIndex.template file.

Following are some of the variables used within this file and an explanation of what they do. The lists below are divided up into sections to make it easier to figure out where they show up within your forums.

Template Tags

Board "Handel" List (shown at the very bottom of the board list in the default templates)
  • {yabb expand} - The button that allows users to expand all collapsed categories, if enabled in the Admin Center - This button should never be removed from or added to a template without removing or adding the button below, as well; as the two are dependent on each other.
  • {yabb collapse} - The button that allows users to collapse all categories, if enabled in the Admin Center - This button should never be removed from or added to a template without removing or adding the button above, as well; as the two are dependent on each other.
  • {yabb markallread} - The button that allows users to mark all topics on the forums as "read"

Showcase Poll
  • {yabb pollshowcase} - The showcase poll will show up in place of this variable, if enabled

Category/Forum List
  • {yabb catsblock} - This is the variable that gets replaced by the list of categories and forums on the board index. This is the main part of the BoardIndex page, and should never be removed from this file.

Board Index Button Bar
  • {yabb boardhandellist} - This is the information you defined above in the "Board "Handel" List" section.

Forum Statistics Area:
  • {yabb totalmessages} - The total number of posts made on your forums
  • {yabb totaltopics} - The total number of topics within which those posts can be found
  • {yabb lastpostlink} - The title of and link to the most recent post on your forum
  • {yabb lastpostdate} - The date and time on which the most recent post was made
  • {yabb recentposts} - A link to show a list of the X (set to 10 by default - I don't remember whether you can change that number or not) most recent posts on your forums
  • {yabb membercount} - The total number of members registered on your forums
  • {yabb latestmember} - The display name of and link to the profile of the member who most recently registered on your boards
  • {yabb ims} - Text telling you how many private messages you have and how many of them are new (with a link to your PM box)
  • {yabb mostusers} - The highest number of users (registered and guests) that have ever been on your forums at one time
  • {yabb mostusersdate} - The date and time on which those members were on your forums
  • {yabb mostmembers} - The highest number of registered users that have ever been logged into your forums at one time
  • {yabb mostmembersdate} - The date and time on which those members were on your forums
  • {yabb mostguests} - The highest number of guest users that have been on your forums at one time
  • {yabb mostguestsdate} - The date and time on which those guests were on your forums
  • {yabb mostbots} - The highest number of search engine bots that were ever on your forums at one time
  • {yabb mostbotsdate} - The date and time on which those search engine bots were on your forums

Users Online Area:
  • {yabb users} - The total number of registered members currently logged into your forums
  • {yabb onlineusers} - The display names of and links to the profiles of (and the IP addresses of, if you are an admin) each user that is currently logged into your forums
  • {yabb guests} - The total number of guests currently viewing your forums
  • {yabb onlineguests} - The IP addresses of (if you have the permission to see those) the guests that are currently viewing your forums
  • {yabb bots} - The total number of search engine bots currently on your forums
  • {yabb onlinebots} - The names/types of search engine bots (and how many of each) that are currently on your forums
  • {yabb groupcolors} - The area that shows which colors are associated with which member groups

Category Header (the look of each category header that is displayed above and wrapped around the list of boards within that category)
  • {yabb catimage} - The icon associated with this category, if activated within the Admin Center
  • {yabb catlink} - The link to show just this category
  • New Message Indicator (only shown when the category is collapsed)
    • {yabb newmsg start} - Some HTML code that opens the table row for this information
    • {yabb newmsg icon} - The HTML code that shows the icon that indicates whether or not there are new posts within this category
    • {yabb newmsg} - The text that indicates whether or not there are new posts within this category
    • {yabb newmsg end} - The HTML code that closes this table row
  • {yabb boardtable} - The ID of the category

Board Block (the look of each board in the list of categories and forums)
  • {yabb boardurl} - The URL to the board that is being displayed
  • {yabb boardpic} - The icon associated with the forum
  • {yabb new} - The HTML code used to display the icon that indicates whether or not there are new posts within this board
  • {yabb boardanchor} - The "Board ID" (as defined when the board was created in the Admin Center) - This is used as an HTML anchor tag, so that you can link to a specific board within the BoardIndex page
  • {yabb boardname} - The name or title of the board being shown
  • {yabb boarddesc} - The description of the board, as set in the Admin Center
  • {yabb moderators} - The list of the moderators for the board being shown
  • {yabb lastpostlink} - The HTML code that shows the icon and link to the most recent post within this board
  • {yabb lasttopiclink} - A link to the topic in which the most recnet post was made
  • {yabb lastposter} - A link to the profile of the member that made the most recent post in this board
  • {yabb threadcount} - The total number of "topics" contained within this board
  • {yabb messagecount} - The total number of "posts" contained within this board

A copy of the default BoardIndex.template file included in the YaBB 2.3.1 package is attached for reference.

The file here has been renamed with a txt file extension. In order to use it, you will need to remove the txt file extension and replace it with an HTML file extension.

Note: The list above is not yet complete. It is in progress, and we will be adding to it as time allows.
« Last Edit: Jan 27th, 2009 at 2:50pm by »  

BoardIndex.txt ( 7 KB | 2 Downloads )
Back to top
 
IP Logged
 
Curtiss Grymala
Ex Member


Re: An Explanation of Template Tags
Reply #3 - Jan 27th, 2009 at 2:54pm
Print Post  
MessageIndex.template

This post will include a complete reference to the template variables used within the MessageIndex.template file.

Template Tags

Topic "Handel" List (this is the row of buttons used to perform various actions related to the current board - in the default template, this row of buttons is shown at the top and the bottom of the message index)
  • {yabb new post button} - Displays the button that allows users to add a new topic to the board.
  • {yabb new poll button} - Displays the button that allows users to add a new poll to the board.
  • {yabb notify button} - Displays the button that allows users to modify their notification settings for this board.
  • {yabb markall button} - Displays the button that allows users to mark all topics in this board as "read" (not new).

Board Moderators (this section is only displayed if the board description is set not to display on the message index and the user is not currently viewing his/her "favorites")
  • {yabb moderators} - Displays the name(s) of the moderator(s) for the board being displayed, with a link to the profile for each of the users listed. This variable is also used in the "Board Description" section.

Board Description (this section is displayed if the board description is set to display on the message index)
  • {yabb bdpicture} - Displays the icon associated with the board being displayed.
  • {yabb board} - Displays the name of the board being displayed, with a link to that board.
  • {yabb description} - Displays the description of the board, as set in Admin Center -> Boards.
  • {yabb threadcount} - The total number of topics in this board.
  • {yabb messagecount} - The total number of posts in this board.

Button Bar (the row of buttons shown at the top of the message index - this section is only displayed if the user is not currently viewing his/her "favorites")
  • {yabb pageindex top} - Displays the menu that allows the user to choose which page of this board to view. This variable shows the menu specifically intended to be shown at the top of the message index.
  • {yabb topichandellist} - Displays the code set in the Topic "Handel" List discussed above. This variable is repeated in the bottom "Button Bar".

Main Area
  • {yabb modupdate} - The HTML code used to open the form that allows moderators to perform bulk actions on the messages in this board.
  • {yabb admin column} - Displays the extra table column that shows the "multi admin" buttons/checkboxes (depending on the configuration settings in the Admin Center -> Forum Settings -> Staff).
  • {yabb stickyblock} - Displays the list of sticky topics in this board.
  • {yabb threadblock} - Displays the list of normal topics in this board.
  • {yabb adminfooter} - Displays the admin "handel" list that allows administrative users and moderators to perform bulk actions on the messages in this board.
  • {yabb modupdateend} - The HTML code used to close the form that allows administrative users and moderators to perform bulk actions on the messages in this board.

Button Bar (the bottom row of buttons)
  • {yabb pageindex bottom} - Displays the menu that allows the user to choose which page of this board to view. This variable shows the menu specifically intended to be shown at the bottom of the message index.

Icon and Access Info (this section is repeated in the template file; one set will be shown if the user is not viewing his/her "favorites", the other will be shown if the user is viewing his/her "favorites")
  • {yabb icons} - Displays the key that explains what the message icons mean (normal topic, sticky topic, locked topic, etc.)
  • {yabb admin icons} - Displays the key that explains what the administrative message icons mean (hidden topic, global announcement, etc.)
  • {yabb access} - Displays a list of the actions the current user is allowed to perform within this board. This information is only displayed if the user is not currently viewing his/her "favorites"

The file here has been renamed with a txt file extension. In order to use it, you will need to remove the txt file extension and replace it with an HTML file extension.

Note: The list above is not yet complete. It is in progress, and we will be adding to it as time allows.
« Last Edit: Jan 27th, 2009 at 4:21pm by »  

MessageIndex.txt ( 7 KB | 3 Downloads )
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Print
 
  « Board Index ‹ Board  ^Top