Hello everyone,
I'm creating some new page types which are actually identical to models I already have, but for a different root domain which will have a different design and branding.
It seemed to me that proxy models would be the ideal solution, as I could set a different template to the new page models while keeping the database clean. However, when I create a new page using a proxy model, the Wagtail admin doesn't seem to differentiate in any way between the proxy and the parent model, and despite using
template ='myapp/other_template.html
or
in the proxy model, pages created using the proxy model are still displaying with the parent's template, and overall simply appear to be of the parent model type, rather than the proxy.
Now I am fairly new to Django so may be misunderstanding the usage of a proxy model – is this the correct behaviour? Am I setting it up incorrectly? Do I need to define something further in the proxy model for it to use the other template?
I suppose another approach would be to not have proxy templates, but instead use a get_template method as described in the docs which tests for which type of parent a page has, and select the appropriate template that way. Is this a better implementation?
Thanks,
-Nick