0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-28 00:17:06 +01:00
wagtail/docs/core_components/pages/index.rst
Tim Heap 15419f4d0e Make RoutablePage a mixin
If a developer wanted to have a site-wide base page class, and also have
some pages be `RoutablePage`s, a conflict between the automatically
generated `page_ptr` fields would occur.

```python
from wagtail.wagtailcore.models import Page
from wagtail.contrib.wagtailroutablepage.models import RoutablePage

class SitePageBase(Page):
    # common functionality
    is_abstract = True
    class Meta:
        abstract = True

class MyPage(RoutablePage, SitePageBase):
    # This model is invalid
    pass
```

`RoutablePage` has been changed to be a mixin `RoutablePageMixin`. Page
classes can use this to gain the `RoutablePage` functionality while
still retaining the ability to subclass other models.

A `RoutablePage` class that derives from both `RoutablePageMixin` and
`Page` has been left in for backwards compatibility, so old code will
continue to function without any modifications.
2014-08-21 19:42:17 +10:00

25 lines
1.2 KiB
ReStructuredText

Pages
=====
.. note::
This documentation is currently being written.
Wagtail requires a little careful setup to define the types of content that you want to present through your website. The basic unit of content in Wagtail is the ``Page``, and all of your page-level content will inherit basic webpage-related properties from it. But for the most part, you will be defining content yourself, through the construction of Django models using Wagtail's ``Page`` as a base.
Wagtail organizes content created from your models in a tree, which can have any structure and combination of model objects in it. Wagtail doesn't prescribe ways to organize and interrelate your content, but here we've sketched out some strategies for organizing your models.
The presentation of your content, the actual webpages, includes the normal use of the Django template system. We'll cover additional functionality that Wagtail provides at the template level later on.
.. toctree::
:maxdepth: 2
theory
creating_pages
writing_templates
model_recipes
editing_api
advanced_topics/queryset_methods
advanced_topics/private_pages
advanced_topics/routable_page_mixin