Re: Creating page types programatically

2016-09-09 Thread Daniele Procida
On Tue, Sep 6, 2016, Patrick Heneghan  wrote:

>It might help for me to explain this in context - for example, I'm going to 
>have a "post type" called "blog", which should have title and content 
>fields, and then "event", which should have additional location, date, and 
>time fields.

Hi Patrick.

I hadn't realised that by Page Type you meant, in effect, a different content 
model.

Page Types in django CMS are a way to take a snapshot of a page for resuse, to 
save you having to re-do a complex layout that you often reuse.

If you want to manage weblog content, or events, use a weblog or events 
application, so that instead of shoe-horning information into unsuitable 
containers, you can have models that are designed to hold it in the most useful 
way.

Other CMSes (like Wagtail and Mezzanine) extend their pages in the way you 
describe, but django CMS has always avoided that as a core principle.

Daniele

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
django-cms-developers+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-cms-developers+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/20160909124333.1996452482%40mail.wservices.ch.
For more options, visit https://groups.google.com/d/optout.


Re: Creating page types programatically

2016-09-06 Thread Iacopo Spalletti
Il 06/09/2016 13:41, Patrick Heneghan ha scritto:
> Posted already to the Github issue tracker, but it was suggested I post
> here instead:
> 
> 
> In other CMS's I've used, it's been possible to define Page Types (or
> "post types") programatically. This is desirable, as it allows me to
> commit these to code, and have them ready for use when the site has been
> installed - rather than going through the manual process of creating
> them via the admin area post-installation.
> 
> 
> Is this possible in Django CMS? It doesn't seem to be documented.

Do you mean "Page Type" in the django CMS meaning (ie: special pages
prefilled with content) or just page templates? In the latter django
templates configured in CMS_TEMPLATES are what you are looking for.

In the former case django CMS Page types are just pages saved under a
special parent.
If you want to ship them together with the code you have two options:
- saving a fixture file with the pre-saved pages
- create a datamigration which creates the pages using create_page /
create_title / add_plugin public API
(http://django-cms.readthedocs.io/en/release-3.3.x/reference/api.html)

Hope this helps

> 
> -- 
> Message URL: *MailScanner has detected definite fraud in the website at
> "groups.google.com". Do /not/ trust this website:*
> https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id 
> 
> Unsubscribe: send a message to
> django-cms-developers+unsubscr...@googlegroups.com
> ---
> You received this message because you are subscribed to the Google
> Groups "django CMS developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-cms-developers+unsubscr...@googlegroups.com
> .
> To view this discussion on the web, visit *MailScanner has detected
> definite fraud in the website at "groups.google.com". Do /not/ trust
> this website:*
> https://groups.google.com/d/msgid/django-cms-developers/04effbc0-fe73-4fc8-a17a-325ab82d701f%40googlegroups.com
> .
> For more options, visit *MailScanner has detected definite fraud in the
> website at "groups.google.com". Do /not/ trust this website:*
> https://groups.google.com/d/optout .


-- 
Iacopo Spalletti

Nephila s.a.s. - Firenze
Telefono: +39 055 5357189
Assistenza Tecnica: +39 055 3985730
http://nephi.la

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
django-cms-developers+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-cms-developers+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/f9f253e2-6d6e-7c5c-e8e1-5ecc5dc34294%40nephila.it.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature