Jamroom Logo
Newsletter
Member Spotlight
229290
FutureBands.com
"Every musician can effortlessly create an account to self-promote themselves. We appreciate all your effort and dedication to the project over the years. You've spent countless hours updating the numerous versions of Jamroom with new features. We could not have done it without you."
Follow Jamroom on Twitter!

{jr_submit_reddit} Index {jr_url}

{jr_unique_block}


The {jr_unique_block} template block function ensures that any code (i.e. HTML, etc.) placed between the "open" and "close" function calls will only ever show 1 time on the output, even if looped over and included into a template a hundred times.

Parameters:

Name Type Required Default Description
name string yes n/a The "name" parameter is a unique string that differentiates the {jr_unique_block} function call from other {jr_unique_block} function calls that may be in the same template.  Without this parameter, Jamroom is not able to link the OPEN and CLOSE calls of the function.

Example:

If you have parts of your page repeating too many times, the jr_unique_block provides a solution. You can use the function in a row template to output a "once only" title even though the row may be looped many times. You can also use a variable as the name, for example $USER_NICKNAME in a page which shows a list of favorites for several Users. This will provide the Heading row only once per User:

{* The jr_unique_block function ensures the title only shows 1 time *}
{jr_unique_block name="$USER_NICKNAME"}
<tr>
  <td width="100%" colspan="5" class="head-1" style="height: 50px;">
      <span style="font-size: 22px">{$USER_NICKNAME}'s Favorites</span>    
  </td>
</tr>
{/jr_unique_block}
...the rest of the row_template code goes outside of the block so it will be repeated as many times as is is looped...

 

Note: Be sure to give a unique "name" to each block you use in your themes, so the internal variable that Jamroom holds the information in while it is working don't overlap. Your Artist sites will rebuild faster as a result.

 


{jr_submit_reddit} page 146 of 171 {jr_url}
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom Core
Jamroom Addons
Jamroom Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2012 Talldude Networks, LLC.