New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagemodel.py template_choices and DEFAULT_TEMPLATE aren't being used #6520

Open
ZippoLag opened this Issue Sep 14, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@ZippoLag

ZippoLag commented Sep 14, 2018

Summary

I was trying to override Page's template_choices and DEFAULT_TEMPLATE so I can limit the options according to a page's parent, but it appears that in at least 3 key places where those attributes should be used, get_cms_setting('TEMPLATES') is used instead, and so the selectable templates displayed are never limited like I intended.

The places I've found where this happens are the get_template and get_template_name methods. Also in cms_toolbars.py for the # templates menu section get_cms_setting('TEMPLATES') is used rather than self.page.template_choices.

More details about what I was trying to pull of can be found, here: https://stackoverflow.com/questions/52335541/how-to-limit-django-cms-template-choices-based-on-page-parent

Expected behaviour

template_choices and DEFAULT_TEMPLATE should define which templates are available for a Page in the CMS.

Actual behaviour

get_cms_setting('TEMPLATES') is always used instead.

Environment

  • Python version: 2.7.x
  • Django version: 1.11.x
  • django CMS version: 3.4.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment