{jrCore_item_list_buttons}

  • Overview

    The {jrCore_item_list_buttons} template function brings the create/update/delete..... and any other buttons that are available to the current user out to the template.

    Its a catch all function created to allow modules to add buttons to other modules locations without the need to adjust their templates.

    In short it says: "Show any buttons that should show here.".

    If you need finer grained control over which buttons show you can swap this function out for in the templates and add in whichever individual buttons you need.
  • jrCore_item_list_buttons

    Function
    jrCore_item_list_buttons
    parameter
    type
    default
    required
    description
    module
    string
    -
    on
    The module name want to show the buttons for, eg: jrAudio
    item
    array
    -
    on
    The $item array that contains the entire item for which you want to show buttons for.
  • Example of Audio buttons

    The code below would typically be used on an items detail page or an items list page to show the update/delete buttons to the profile owner. There may be other buttons registered by modules that do not come from the module itself such as a 'download' button provided by the core, or a 'purchase' button provided by the shopping cart module if the module is for sale.
    {jrCore_item_list_buttons module="jrAudio" item=$item}
  • Using different buttons

    If you wanted to swap out the buttons for different buttons you could use something like this to construct whatever structure you wanted to build for a button:
    {jrCore_module_url module="jrAudio" assign="murl"}
    {if ...................}
         <a href="{$jamroom_url}/{$murl}/download/audio_file/{$item._item_id}">{jrCore_image image="download.png" alt="Download" title="Download"}</a>
    {/if}
  • another way

    Or if you like the formatting of the buttons but want more fine grained control over each button displayed you can add the individual buttons in in this syntax:
    {jrCore_item_create_button module="jrAudio" view="create" profile_id=$_profile_id title="Create Audio"}
  • Exclude

    If you would like to exclude buttons from being displayed in the template you can use the exclude="(button function name)"

    for example if you want to get rid of the update and the delete button that the core system provides use:
    {jrCore_item_list_buttons module="xxYourModule" item=$item exclude="jrCore_item_update_button,jrCore_item_delete_button"}

Share This

Tags