sachatrauwaen / OpenContent

Structured Content editing for DNN (Dotnetnuke)
46 stars 25 forks source link

OC5 editor v2 Partial templates not working in Single Type Templates (?) #191

Open Timo-Breumelhof opened 1 year ago

Timo-Breumelhof commented 1 year ago

I have this template and I have to set it to Multiple for a partial template to work it seems.

Manifest:

{
    "editWitoutPostback": true,
    "index": true,
    "templates": {
        "base": {
            "type": "single",
            "title": "base",
            "main": {
                "template": "template.hbs",
                "partialTemplates": {
                    "heading": {
                        "template": "heading.hbs",
                        "clientside": false
                    }
                },
                "clientSideData": false
            }
        }
    }
}

Template.hbs:

<h2>{{>heading}}</h2>

Heading.hbs:

Heading from partial template

This does not work:

Template error
Failed to render Handlebar template Portals/opencontent-demo-templates/OpenContent/Templates/02.01-HBS-Partial-Templates/template.hbs
Referenced partial name heading could not be resolved

If I change "type": "multiple", the partail template does work.

Usecase:

I have a central partial template that I use to render image srcset. It would be nice I could also use that for Single data templates