Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding content types to django-cms

Tags:

django-cms

I realise the point of django-cms is to not have content types and treat everything as a Page, but ignoring that for the moment, how would I go about adding them to django-cms? By "content type", I mean something that behaves a lot like a Page object i.e. has a URL, title, plugins etc, but also has additional custom fields.

I looked at http://ilian.i-n-i.org/extending-django-cms-page-model/, which is almost perfect, except that it just adds extra fields to the existing Page class. So if you wanted two new content types such as Event (extra fields: start_date, end_date) and Venue (extra fields: latitude, longitude), every time you added a Page you would see the fields for both of these content types, even if you only wanted to create an Event or a Venue (or even just a standard Page).

Any ideas?
Thanks
Tom

like image 874
tomds Avatar asked Sep 03 '25 15:09

tomds


1 Answers

I ended up working around this using plugins. For anyone interested, the details are at http://blog.isotoma.com/2013/01/content-types-and-django-cms/.

EDIT: With Django CMS 3, you can now use the new Page Extension model http://docs.django-cms.org/en/stable/how_to/extending_page_title.html

like image 84
tomds Avatar answered Sep 05 '25 14:09

tomds