{jrCore_module_function}

  • Overview

    The {jrCore_module_function} template function allows you to setup your templates to fire functions and not have to worry about whether those modules exist in the system or not.

    Its a safe way of calling a module that might be turned off.

    The parameters of the call include the name of another module and its parameters.

    If the function exists and the module is turned on, it will fire. Otherwise it will fail silently.

    This avoids the situation of "Function not found" errors because the modules weren't available.
  • Examples of usage

    There are many examples of usage in the templates themselves. Run a search for this function will turn up many examples.

    Here are a few:
    {jrCore_module_function function="jrRating_form" ...........
    {jrCore_module_function function="jrImage_display" ...........
    {jrCore_module_function function="jrPrivateNote_link" ...........
    {jrCore_module_function function="jrFollower_button" ...........
    {jrCore_module_function function="jrFoxyCart_add_to_cart" ...........
    {jrCore_module_function function="jrPlaylist_button" ...........

    And there are many more too.

    Its a safeguard. The alternate way of writing:
    {jrCore_module_function function="jrPlaylist_button" ........}

    is:
    {jrPlaylist_button ........}

    But in this second case you need to KNOW that the jrPlaylist module exists in the system and is currently enabled. Otherwise you risk that function not being found and the page failing to load because the function can't be found.
  • It allows for forward planning

    Skin designers can't know what modules will or will not be available to them.

    If they want to include ratings that are provided by the jrRating module they can with the use of this template function.

    If the module exists, the function runs. If it doesn't, no worries.

Share This

Tags