To change a template

When I change the template of a page, enonic removes all of the components that I have added on my page. How might I avoid this behavior? Is there a new version that resolves this situation?

Thank you for your help.

1 Like

Hi. The general idea of a page template is that it contains all the setup you need, including parts etc. If we were to try to merge page setup from one template to another this might very often fail, for instance if you don’t have main regions in both templates.

I reckognice a potential use-case here, but this is not the way it currently works… We have already implemented support for switching layouts while keeping parts inside it - maybe something similar could be achived for page templates too…


If I understand this question correct (correct me if I am wrong), this is the rub:

You have spent the whole afternoon crafting this fine poem about your cat, saved it and published it (now it is safe, right?) - and then you (or your little sister) get curious about this ‘Renderer’ dropdown on the right side (se screenshot below) and for example tries switching it from ‘Custom’ to ‘Automatic’, and your entire creative work is deleted forever, even if you did not press apply, save draft or publish, and even by switching it back - the page remains as empty.

I can see that this is frustrating and unexpected. Especially if your parts on the page are configured with a lot of inputs with content. I am using XP version 6.3.0-SNAPSHOT, so it might be a bug, or is this expected behaviour @tsi? If so, I suggest:

  1. Display a warning: “Woah! You sure? Doing this will permanently erase all the stuff on this page?”
  2. Temporarily save the page setup so user can switch back and retrieve it upon discovering the consequences of their action. At least until the page is saved or published.

Deep into that darkness peering, long I stood there wondering, fearing,
Doubting, dreaming dreams no mortal ever dared to dream before;
But the silence was unbroken, and the stillness gave no token,
All my parts have vastly broken, and my page was blank as chlore
And the only word there spoken was the whispered word, “what for?”
All my content is deleted! Be there no solution, no backdoor?
Merely this and nothing more.


+1 on alerting the user about this. We need an alert for clumsy fingers, or the case were you just wanna try “what happens if …”.

I have a support/feature request about this filed internally long ago but can’t seem to find it now.

Valid points indeed… I was (for historical reasons) way to focused on that the data is in the form, but naturally you might have all your valuable data in the page too now :-).

Prompting, or giving the user an option to “keep” data would be an interesting approach. Also, if you have multiple available page templates for a single content type this should preferably use the same regions etc. I know this might sound simple to solve, but there are quite a few caveats to avoid.

Also, there is the “reset” button for a page that will give you the “au naturale” version… it that’s what you actually wanted!

I’m going to configure my templates with all the setup
Thank you for your help.

Are you saying you will add “config options” to your page template rather than multiple templates?

I will config multiple templates

Is there any news on this topic? Still very terrifying that selecting a new template in the ‘Page Template’ dropdown deletes content build on a page, even without pressing ‘appy’ or ‘save draft’.


Now at least you can revert the page to the previous version with the versioning widget as long as you saved it before changing templates.

1 Like

This is true, and makes it more reliable, but still not a good permanent solution to the issue, especially not for a non-expert user, say a content publisher. The state of the page should not be changed just by selecting a page template in a content selector.