I would like to add some extra fields to pages in django-cms (in django admin panel). How do this in the simplest way?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create a new app (called
extended_cmsor something) and inmodels.pycreate the following:then create an
admin.py:which will add your extended model to as an inline to any page you create. The easiest way to access the extended model setttings, is to create a context processor:
and now you have access to your extra options for the current page using
{{ extended_page_options.my_extra_field }}in your templatesEssentially what you are doing is creating a separate model with extra settings that is used as an inline for every CMS Page. I got this from a blog post previously so if I can find that I’ll post it.
EDIT
Here is the blog post: http://ilian.i-n-i.org/extending-django-cms-page-model/