'Changing Template Location in Wagtail
I'm trying to direct wagtail to use a template in a centralised location at the top of the project tree. So for example:
Project
|_ HomePage
|_ Search
|_ Mypage
|_ templates
My project re-uses templates and I'd like to give UX/UI Developers access to a single folder rather than multiple sub-folders in multiple pages.
I've tried in Mypage/models.py
class AdvisorSummaryPages(Page):
intro = models.CharField(max_length=250, blank=True, null=True)
content_panels = Page.content_panels + [
FieldPanel('intro'),
InlinePanel('carousell', heading="Carousell Images")
]
template = "advisors.html"
With the following template setting in Project/Project/settings/base.py
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
With no luck. I can't seem to find any solution on SO or through the documentation or Google that might work. There is a solution presented here using separate model admins but that doesn't work for me. How might I specify the location of the template differently to a subdirectory of templates in the MyPage App?
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
