Main Content

Magnolia Community Forums: Get help with Magnolia: Site module prototype templates fail to render


  • arjen
    arjen
    Full name: Arjen Schipmolder
    Posts: 15
    Last post: Nov 30, 2017 11:43:44 AM
    Registered on: Jul 12, 2017
    Site module prototype templates fail to render
    #1 by arjen on Jul 12, 2017 3:58:56 PM

    Hi,

    I've been given an existing project to add some new features to but I'm stuck getting the existing project to run smoothly to begin with and I was hoping someone has seen this issue before and can give me some pointers...

    After troubleshooting I narrowed the cause of the issues down to the use of template prototypes that, for some reason, don't work but instead I get an exception when loading any page using these templates:

    RenderException: No template script defined for the template definition [info.magnolia.rendering.template.configured.ConfiguredTemplateDefinition@444d333f[id=custom-templating-module:pages/category,name=category,renderType=site,description=<null>,title=Category,templateScript=<null>,autoGeneration=info.magnolia.rendering.template.configured.ConfiguredAutoGeneration@285f9021[content={},generatorClass=<null>]]]
    info.magnolia.rendering.engine.RenderException: No template script defined for the template definition [info.magnolia.rendering.template.configured.ConfiguredTemplateDefinition@444d333f[id=custom-templating-module:pages/category,name=category,renderType=site,description=<null>,title=Category,templateScript=<null>,autoGeneration=info.magnolia.rendering.template.configured.ConfiguredAutoGeneration@285f9021[content={},generatorClass=<null>]]]
    at info.magnolia.rendering.renderer.AbstractRenderer.render(AbstractRenderer.java:148)
    etc
    etc


    When checking the JCR all pages have their renderType set to 'site' and they have no templateScript set.
    I then checked for the prototype node in the JCR as per the user guide (https://documentation.magnolia-cms.com/display/DOCS/Template+prototype) and found it here:

    /modules/custom-templating-module/config/<project name>/templates/prototype

    This has one templateScript parameter which is set to /custom-templating-module/templates/pages/main.ftl (and for the rest it's got definitions for the different areas)

    I checked all paths and this template does exist and looks ok to me.

    Eventually, as a test, I ended up changing the category page template and set it's renderType to freemarker with templateScript to the same main.ftl file and that works fine up to the first @cms.area include as that too fails, but at least i know rendering via freemarker alone does work.

    Does anybody have any ideas why the site module wouldn't work or how to troubleshoot this further?

    Thanks!
    Arjen

    Magnolia Community 5.4.5
    (dependencies include magnolia-site and magnolia-site-app)
    JRE 1.7
    Tomcat 7

  • arjen
    arjen
    Full name: Arjen Schipmolder
    Posts: 15
    Last post: Nov 30, 2017 11:43:44 AM
    Registered on: Jul 12, 2017
    Re: Site module prototype templates fail to render
    #2 by arjen on Jul 13, 2017 10:46:04 AM

    Never mind this, after a long night of troubleshooting it turned out I wasn't given all the configurations from the JCR causing the site module not to work properly.
    After importing the missing JCR bits it immediately recognised the prototype and rendered the templates ok.

  • twinkel
    twinkel
    Full name: Stef te Winkel
    Posts: 12
    Last post: Nov 22, 2017 2:13:24 PM
    Registered on: May 23, 2012
    Re: Site module prototype templates fail to render
    #3 by twinkel on Nov 21, 2017 6:51:09 PM

    Hi Arjen,
    I am currently bumping into the same wall, could you elaborate a bit more (if you still remember) what the missing JCR bits were causing the prototype not to render?

    Thanks in advance!
    Stef

  • marvink2
    marvink2
    Full name: Marvin Kerkhoff
    Posts: 45
    Last post: Nov 22, 2017 9:14:20 AM
    Re: Site module prototype templates fail to render
    #4 by marvink2 on Nov 22, 2017 9:04:37 AM

    Hi Stef,

    For Enterprise usage search inside the config of the multisite module if there is still a prototype defined and you have defined the prototype id.

    For Community usage search inside the config of the site module. This could either be a problem in enterprise if the site module is not extending the multisite module.

  • twinkel
    twinkel
    Full name: Stef te Winkel
    Posts: 12
    Last post: Nov 22, 2017 2:13:24 PM
    Registered on: May 23, 2012
    Re: Site module prototype templates fail to render
    #5 by twinkel on Nov 22, 2017 2:13:24 PM

    Marvin, thank you for your response!

    I solved it, by trying different scenario's, can't realy tell which one was the real dealbreaker.

    A few things I noticed:
    - In the Magnolia Travel Demo a mix in template availability is used, the Explicit assignment and the rendering based upon Rendertype
    - In the documentation on https://documentation.magnolia-cms.com/display/DOCS56/Template+prototype the Prototype template class of the Travel demo is stated as PageTemplateDefinition (Git) (a custom definition class used in the Travel Demo). But actually the PrototypeTemplateDefinition class is used

    I configured the prototype the Yaml way, and the combination of the following made it work:
    - using class info.magnolia.module.site.templates.ReferencingPrototypeTemplateSettings in Site Module
    - using enableAll true with availability and empty templates content node
    - using class: info.magnolia.module.site.templates.PrototypeTemplateDefinition and renderType:site in prototype template
    - using class: info.magnolia.module.site.templates.PageTemplateDefinition in Page template definition with renderType: site
    - when switching from JCR setup to Yaml setup, don't forget to delete the Prototype node

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/