Jump to content
  • [Beta3-Developer mode] Using custom templates


    I have created an application, and it uses a few custom templates. I placed these templates in MyAPPDirectory\dev\html\global and in dev center > templates I create new template as hook and with following I can show my template where I targeted:

    {template="template1" app="MyAPPDirectory" location="global" group="" params=""}

    While this working and display template normally in my dev localhost, if I download app and install it in website with dev mode off, I get error. here the system log:

    1. 
    Template store key: template_2_1f1e54e373ef30db179861d0bf0bea57__ missing (MyAPPDirectory, global, )

    2. 
    Error: ErrorException: template_store_missing in /.../system/Theme/Theme.php:921
    Stack trace:
    #0 /.../system/Theme/CustomTemplate.php(458) : eval()'d code(24): IPS\Theme->getTemplate('', 'MyAPPDirectory...', 'global')


    I can get around this with copy/paste contents of my .phtml custom file directly in template hook page in dev center. or make one reusable template for contents, and another template to hook the reusable template to a target.
    It seems it is a major bug... or era of working on custom templates with IDE is over.


    User Feedback

    Recommended Comments

    Adriano Faria

    Posted (edited)

    You need to inform the group: group="".

    You don’t need to inform the location (admin or front) if it will be used in same location.

    Edited by Adriano Faria
    beats23

    Posted

    1.
    Same exact issue happens without inform the location as well:
    {template="template1" app="MyAPPDirectory" group="global" location="" params=""}

     

    Display normally only with website dev mode on.


    2.
    And when I remove location completely:
    {template="template1" app="MyAPPDirectory" group="global" params=""}

    It give error for:
     BadMethodCallException
    NO_TEMPLATE_FILE - .../applications/MyAPPDirectory/dev/html/front/global/template1.phtml

     

    Which is not the right address.


    3.
    I move my template to this directory: MyAPPDirectory/dev/html/front/ and using this:
    {template="template1" app="MyAPPDirectory" group="front" location="" params=""}

    Exact same issue as described at first post. display without issue with dev mode on, and when install app somewhere else without dev mode, it produce template error.

    4.
    Also this and remove completely:
    {template="template1" app="MyAPPDirectory" group="front" params=""}

    Give error:
     BadMethodCallException
    NO_TEMPLATE_FILE - .../applications/MyAPPDirectory/dev/html/front/front/template1.phtml

    Same as test 2 with wrong address.

    5.
    So in my last test, I moved my template where BadMethodCallException say:
    /applications/MyAPPDirectory/dev/html/front/front/ 

    With two front folder back to back and put my template there:

    {template="template1" app="MyAPPDirectory" group="front" location="front" params=""}

     

    And now it works on both dev mode off or website without dev mode. 
    It seems location must always be stated and must always be something.

    for example in my description at first comment, I can now fix my initial issue if I move all templates to another global folder inside: MyAPPDirectory/dev/html/global/global/
    And state this to work normally:
    {template="template1" app="MyAPPDirectory" location="global" group="global" params=""}

    I still think it is a bug and wasn't like this before. using two folder for custom templates seems weird.

     

    Adriano Faria

    Posted

    15 minutes ago, beats23 said:

    1.
    Same exact issue happens without inform the location as well:
    {template="template1" app="MyAPPDirectory" group="global" location="" params=""}

     

    Display normally only with website dev mode on.


    2.
    And when I remove location completely:
    {template="template1" app="MyAPPDirectory" group="global" params=""}

    It give error for:
     BadMethodCallException
    NO_TEMPLATE_FILE - .../applications/MyAPPDirectory/dev/html/front/global/template1.phtml

     

    Which is not the right address.


    3.
    I move my template to this directory: MyAPPDirectory/dev/html/front/ and using this:
    {template="template1" app="MyAPPDirectory" group="front" location="" params=""}

    Exact same issue as described at first post. display without issue with dev mode on, and when install app somewhere else without dev mode, it produce template error.

    4.
    Also this and remove completely:
    {template="template1" app="MyAPPDirectory" group="front" params=""}

    Give error:
     BadMethodCallException
    NO_TEMPLATE_FILE - .../applications/MyAPPDirectory/dev/html/front/front/template1.phtml

    Same as test 2 with wrong address.

    5.
    So in my last test, I moved my template where BadMethodCallException say:
    /applications/MyAPPDirectory/dev/html/front/front/ 

    With two front folder back to back and put my template there:

    {template="template1" app="MyAPPDirectory" group="front" location="front" params=""}

     

    And now it works on both dev mode off or website without dev mode. 
    It seems location must always be stated and must always be something.

    for example in my description at first comment, I can now fix my initial issue if I move all templates to another global folder inside: MyAPPDirectory/dev/html/global/global/
    And state this to work normally:
    {template="template1" app="MyAPPDirectory" location="global" group="global" params=""}

    I still think it is a bug and wasn't like this before. using two folder for custom templates seems weird.

     

    You can’t use location=“”.

    LOCATION will always be admin, front or global.

    GROUP is the directory inside the location.

    Forum index, for example, is:

    {template=“index” location=“front” group=“index” app=“forums”}


×
×
  • Create New...