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

Template Functions for use in Jamroom Templates: Index {jr_advert}

{jr_admin_menu}

Overview:

The {jr_admin_menu} Template function is used for creating and embedding a Control Panel menu (for an artist user, member user or admin, including the master admin) into a Jamroom Control Panel template.

Usage:

Place the {jr_admin_menu} function, along with any additional parameters into a template that is used in the Jamroom Control Panel.

Parameters:

Name Type Required Default Description
sections_only true/false no false The "sections_only" param can be passed in as true if you want the Menu to only show the menu "sections" - i.e., it will only generate a section header/footer for each section, but not for the individual "elements" within each section.  For example, in the "songs" section of the artist control panel, this option would simply generate a "songs" section WITHOUT the "create song", "modify song", etc. options.
elements_only true/false no false

The "elements_only" parameter is similar to the sections_only parameter, but does just the opposite - it only loops through the "elements" that are INSIDE a section.

include_sections string no n/a

The "include_sections" parameter can be used to declare that only certain sections will be shown - those included in the "include_selections" list.  For example, if you only wanted to show the "blogs" and "songs" section of the artist menu, you would use:

include_sections="section_blog,section_song"

exclude_sections string no n/a

The "exclude_sections" parameter will do the opposite of the "include_sections" parameter - it will exclude any of the listed sections from showing in the menu.  For example, if this was used:

exclude_sections="section_video,section_photo"

Then ALL menu sections would be rendered EXCEPT the Video and Photo sections.

template string no "menu.tpl" The "template" parameter allows you to define the template that will be used to create the menu.  By default, Jamroom will look for the Skin_Name/cp/menu.tpl file and use that, but you can define alternate templates using the template parameter if needed.

 

Valid Section Names:

The following "sections" are valid for use in the include_sections and exlude_sections parameters:

Artist and Member Menu:

  • section_artist
  • section_blog
  • section_song *
  • section_video *
  • section_photo
  • section_event *
  • section_vault *
  • section_store *
  • section_radio
  • section_channel
  • section_content
  • section_site
  • section_menus
  • section_extra

* These section will not be available to a "Member" User when logged in

Master Admin Menu:

  • section_admin_options
  • section_admin_support
  • section_admin_cluster
  • section_admin_content
  • section_admin_users
  • section_admin_blog
  • section_admin_radio
  • section_admin_channel
  • section_admin_content
  • section_admin_guestbook
  • section_admin_extra
  • section_admin_menus

Examples:

embedded {jr_admin_menu} function call in Control Panel template:

{jr_admin_menu sections_only="true" template="menu_options.tpl" exclude_sections="section_admin_menus,section_menus"}

Contents of menu_options.tpl:

{if is_array($JR_MENU_ELEMENTS)}
   {foreach from=$JR_MENU_ELEMENTS item='_element'}

     {if $_element.type == 'menu_header'}
       {* code in this section will show at the TOP of the menu *}

     {elseif $_element.type == 'menu_active_profile'}
       {* code in this section will show where the "active profile" is displayed *}

     {elseif $_element.type == 'menu_button'}
       {* code placed here will show for each "element" in a section *}

     {elseif $_element.type == 'menu_section_begin'}
       {* code placed here will be displayed at the START of a section *}

     {elseif $_element.type == 'menu_section_end'}
       {* code placed here will show at the END of a section *}

     {elseif $_element.type == 'menu_footer'}
       {* code placed here will show at the BOTTOM of the renedered menu *}

     {/if}
  {/foreach}
{/if}


Template Functions for use in Jamroom Templates: page 95 of 171 {jr_advert}
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