Relations between plugin, template file and template arrays name / Tip and tricks / Forums

  • Maybe this works this way long time but I suppose it was fixed during time, because I needed to have workaround for this.

    plugin name:  jm_download

    template file name:  jm_download_template.php

    template array name: $JM_DOWNLOAD 

    template items:  ['latest_menu']['start']

    It can be loaded 



    $template=e107::getTemplate('jm_download','jm_download', 'latest_menu');
    First one returns all templates, second one just sets for latest_menu. 

    plugin name:  jm_download

    template file name:  download_template.php

    template array name: $DOWNLOAD 

    template items:  ['latest_menu']['start']

    $template=e107::getTemplate('jm_download','download', 'latest_menu');

    So now I don't need to have boostrap and table version in one file, but I can do:

    if(deftrue('BOOTSTRAP')) // v2.x



    else $template=e107::getTemplate('jm_download','table');

    This is how it should work. And templates files could be now cleaner. 

    So template file name and template array name have to be the same (just capitalize).  Again, maybe it works this way from the beginning, but I couldn't get it works, I asked many time for this... So imagine my suprise now that it was to much easy to set :) 

    Of course, with new plugin I will do only div version, but there are old plugins with table layout...  And this can be applied for different version for bootstrap3 and bootstrap4... 


  • added 6.12. template array name has to name + _TEMPLATE,

    added 2.1.2019 - new file has to exists under plugin template, otherwise only theme template is not loaded. If theme file exists, it still load plugin template file.

Moderator(s): CaMer0n, Jimako
Search just forum
You must be logged in to post comments on this site - please either log in from the Login box or from here.

  • Jimako
    Jimako  2 weeks ago

    testing new magic shortcodes, so any weird breadcrumbs are an intention

  • Jimako
    Jimako  1 month ago

    Just playing with google custom search. It's searching this site, and github with e107 in repository name.

  • Jimako
    Jimako  2 months ago

    If you use any my theme: with version 2.2.0 there are core changes - comments and social icons - if you find problem, just tell me.

  • Jimako
    Jimako  5 months ago

    @wrxxy I am ill, sorry cant log in gitter from mobile. Try ask at main room, nothing except update was changed.

  • Jimako
    Jimako  6 months ago

    @wrxxy I got notification from gitter but I am off until Monday. I am not able to log in gitter. Answer is add it to existing gitjub issue.