Because of the range and flexibility of Jamroom, there is a wide variety of content that developers will want to pull into their pages. Some of this content will need to be "live" and parsed on each page load (login status for example), whilst other things are only parsed when the Artist theme is rebuilt.
The following Template Functions have been created to allow for bringing a range of content into your Jamroom Templates:
{include} |
Include another smarty template at parse time. In an artist theme this will generate the content when the site is rebuilt.
{include file="`$THEME_DIR`/menu.tpl"} |
{jr_theme_template} |
Process a template through htmlShowTemplate (like embedding an index.php processed template into an artist template). This should only be used if the template needs to be parsed on each load of the artist page, for example jr_index_status.tpl:
{jr_theme_template template="jr_index_status.tpl" tpl_dir="skin" skin="Cobalt"}
Note: Scripts like Guestbook and Comment need to use {include} as they are not strictly part of the Artist theme. These templates are parsed directly rather than by the theme generator, so on these pages you would need to use:
{include file="`$JAMROOM_DIR`/skins/Cobalt/jr_index_status.tpl"}
|
{jr_theme_php_include} |
Embed a <?php include() ?> in an artist page. This is the way to include a php file into your Artist theme. For example, the line othermenu.tpl | othermenu.php in theme.cfg will generate the file othermenu.php into your Artist member directory when the site is rebuilt. You can then pull that file into the page like this:
{jr_theme_php_include file="`$ARTIST_DIR`/othermenu.php"}
|
{jr_fetch} |
Replacement for {fetch}, it will fetch a URL and works on systems that have allow_url_fopen off:
{jr_fetch file="`$ARTIST_URL`/side.php"}
|
Using"{include}" brings the script into the same process as the currently running script. However, using {jr_fetch} pulls the data in via a separate HTTP process, so the called script gets its own "working space" so to speak. It's better to use {include} since it is faster, but in some situations the only choice is to use {jr_fetch}.
|