OpenContent icon indicating copy to clipboard operation
OpenContent copied to clipboard

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

Open Timo-Breumelhof opened this issue 3 years ago • 0 comments

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 partial 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

Timo-Breumelhof avatar Oct 12 '22 14:10 Timo-Breumelhof