Jamroom Logo Jamroom 5 Core
is now Open Source!
Follow Jamroom on Twitter!

This document applies to Jamroom 3 only!
For current Jamroom 4 Documentation, visit the main Jamroom Documentation section.

Jamroom 3 Appearance Related Questions Index Jamroom 3 Errors and Issues

FAQ: Questions about Jamroom Templates

  1. How do I start editing my Jamroom templates?
  2. How can I see which variables are available in a particular template file?
  3. Why do my URLs contain display code in the results from search.php?
  4. How do I Count Page Hits in Templates for Display in Stats?
  5. What does a variable like this mean: {$_entry.COMMENT_USER_URL}?
  6. How can I edit the e-mails sent by my Jamroom/where can I find the e-mail templates?

 


How do I start editing my Jamroom Templates?

Before making any changes to your template files you should familiarize yourself with the documentation on these pages:

Note: It is highly recommended to make a copy of the Cobalt theme or whichever template set you are editing and install your copied template to work on. This means you can always swich back to Cobalt to compare and see the changes you are making. Even better, when changing your theme make two Artist Quotas and assign your new theme templates to one and Cobalt to the other, this is invaluable when upgrading Jamroom.

Copy your skin or theme directory. You will need to change the name of the folder and any named files such as Cobalt.css. In the case of a skin there must be a file called "jr_index.tpl" located within the skin sub directory. For a theme you need to change the name in config.cfg.php. You may also want to find/replace all hard coded instances of the word Cobalt throughout all of the files. Then you can install your skin or theme and change the settings in the Admin control panel to display your copied templates.

 

How can I see which variables are available in a particular tpl file?

If you want to get a "dump" of all of the Template variables that are available to you in the Jamroom templates add the following line of code to your template, save and rebuild if in a theme tpl:
{debug output="html"}
This will output a complete list of the variables available for your use in the template where you have placed the code. There are a lot of variables, a very long list will be printed to the page - you will not want to leave this on your live site!
Note: The table of available variables will relate to the template in which you place the code, not the entire page. So if you place it in a header_template the list will be different to that from a row_template. When placed in a row such as store_list.tpl, one table will be output for each loop - you will see a complete variable dump for each store item on the page.
 

Why do my URLs contain display code in the results from search.php?

A Jamroom search highlights the search-term in the results returned from search.php. Normally this works perfectly, but if you have edited your search templates to link to specific pages or added in title attributes that contain a searched term you will see display information inserted into the url or title. Obviously this breaks the URL or makes the title attribute incorrect.

Appending _ORIG to a variable gives the original variable name, and can be used to provide clean, un-highlighted results in search as well as in other situations.

An example: {$ITEM_NAME|jr_theme_string} is replaced by the item name at parse time, Tropical_Pop. A search for the word "pop" will cause the variable to be displayed as Tropical_bspan_classjmFont3Popspanb.

The fix: Use {$ITEM_NAME_ORIG|jr_theme_string} instead.



How do I Count Page Hits in Templates for Display in Stats?

Jamroom 3 has four ways of counting a page "hit" so it appears in the Jamroom stats area:

{$HIDDEN_COUNTER} - In Artist theme templates this will record the hit, but not return any "number", so the counter is hidden.
{$PAGE_COUNTER} - In Artist theme templates this records the hit, and returns a number (i.e. 16354) that can be used on the website.
{$PAGE_COUNTER_FORMATTED} - same as {$PAGE_COUNTER}, but the number returned will be in grouped thousands - i.e. "16,354"
{jr_counter} - If the page you want counted is NOT created by the Jamroom Theme Generator (i.e. it is created by the Ranking System, such as the user profile pages in the Cobalt theme), you can use the {jr_counter} template function:
{jr_counter band_id=$BAND_ID pagename="visible page name"}

Unless using the pagename attribute with jr_counter, you will need to have named title tags within the <head> to provide meaningful page names in the stats, otherwise the stats will show up as the name of the php file.
{jr_counter band_id=$USER_BAND_ID pagename="`$USER_NICKNAME` Favorites"}

You can also use a different function, {jr_counts} to return the number of Page Views for all days.

What does a variable like this mean: {$_entry.COMMENT_USER_URL}?

This is a variable taken from within an array. The best way to see what is going on with them might be to place {debug output="html"} into jr_comments.tpl within the foreach loop. All of the variables available within the loop are printed out. Variables in the left column are available directly {$COMMENT_COUNT} & {$COMMENT_TYPE} and have their value printed in the right column. Scroll on down and you will see {$_entry} in the left column. This doesn't have a single value to the right, but it's own list of values which are available within the {$_entry} array.

The values within this array are not available directly, you would have to call the array first and then access the desired item within that array. Hence $_entry gets you into the array, COMMENT_USER_URL gets you the value you want from within the array.

An example debug output: 

{$_entry}                    Array (46) <-- there are 46 items in this array
                                    COMMENT_ID => "4"
                                    MESSAGE_ID => "9"
                                    COMMENT_TIME => "1165927616"
                                    COMMENT_USER => ""
                                    COMMENT_TEXT => "Comment on Desert Island Disc to see ..."
                                    COMMENT_TYPE => "video"
                                    ...
                                    COMMENT_USER_URL => "http://www.mydomain.co.uk/music"



Sometimes you will see three variables strung together with "." between each.  $_VAULT.$VIDEO_VAULT_ID.VAULT_DETAILS.bitrate (wow - that's a mouthful). Fortunately you can access many of these via plugins, so {jr_theme_vault_details id=$SONG_VAULT_ID detail="bitrate"} will display the same info.

Another example debug output: 

{$_VAULT}         Array (4) <-- there are 4 items in this array, each is an array
                                83 => Array (32) <-- this is the video vault id array which has 32 items, some of which are arrays
                                    VAULT_ID => "83"
                                    VAULT_BAND_ID => "27"
                                    ...
                                    VAULT_PCOUNT => "0"
                                    VAULT_DETAILS => Array (12) <-- this is a 12 item array
                                        size => 5041223
                                        atime => 1165169487
                                        mtime => 1165169487
                                        ctime => 1165169487
                                        extension => "mp3"
                                        image => "mp3.png"
                                        bitrate => 160
                                        smprate => 44100
                                        length => "04:12"
                                        audio_type => "audio/mpeg"
                                        category => "audio"
                                        mimetype => "audio/mpeg"



How can I edit the e-mails sent by my Jamroom/where can I find the e-mail templates?

All e-mail sent by Jamroom are controlled via the templates in the jamroom/templates/email/ directory.

How can I change the error messages that Jamroom displays?

There are two ways to change the "error" messages that might be displayed by Jamroom.  If you would like to change the actual text of an error message, you will need to edit the corresponding language string found in your control panel language file (i.e. english.lang.php) in your jamroom/language directory.  If you want to change the "look" of the Jamroom error messages, you can create a file called jr_error.tpl in your active skin directory (i.e. jamroom/skins/(skin_name)/) and style your error pages in that template.  You can use a {debug output="html"} function to see the available variables you can use.

Jamroom 3 Appearance Related Questions page 35 of 185 Jamroom 3 Errors and Issues
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom 5
Jamroom 5 Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2024 The Jamroom Network