{jrCore_module_url}

  • What does this template function do?

    The {jrCore_module_url} functions purpose is to get the current url that a particular module is using.

    All modules will define what URL they want to use by default, but the admin user can always change this URL to anything they want.

    So instead of assuming the default URL is still valid, this template function will return the current URL of that module.
  • screenshot of the INFO tab of the jrAudio module
  • For example a site that deals with beats and beat battles might not want to call their audio files section 'audio' as beatbattle.com/audio/..... doesn't fit with their image of what their site does.

    So in the admin panel they change the URL of the jrAudio module to use the URL 'beats' instead.

    So from then on the URL for the jrAudio module is 'beats'.
  • screenshot of the jrAudio module now using 'beats' as its URL
  • Since is possible for the admin to change it whenever they want, to whatever they want. This makes it necessary for there to be a way for skin and template designers to look-up what the current value for the modules URL is.

    That is the purpose of the {jrCore_module_url} function
  • {jrCore_module_url}

    Function
    {jrCore_module_url}
    parameter
    type
    default
    required
    description
    module
    string
    -
    on
    enter the name of the module you want to look up. eg module="jrAudio"
    assign
    string
    -
    off
    if you add an assign value the returned text will be assigned to that value.
    There arn't to many use-cases to document. The normal way to use this function is like this:
    {jrCore_module_url module="jrDocs" assign="murl"}

    Then use {$murl} in any URL where you need it.
  • Example of usage

    Take a look at the item_list.tpl file in the jrAudio module to see this function in action.

    Its fired at the top of the template then used in multiple places throughout the file.
    {jrCore_module_url module="jrAudio" assign="murl"}
    <a href="{$jamroom_url}/{$murl}/..........">link to somewhere audio.....</a>

Share This

Tags