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');

    OR 

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

    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

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

    }

    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):
Search just forum
Chatbox
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

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

  • Jimako
    Jimako  1 month 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.

  • Jimako
    Jimako  3 months ago

    I will be on holiday until end of November. So no answers from me until then.

  • Jimako
    Jimako  3 months ago

    After 2 days I was able to create demo of BS Magazine 01 theme:
    https://v2demo.e107.sk/magazine01/

  • Jimako
    Jimako  3 months ago

    My antivirus software blocked and disabled gitter.