mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-16 21:11:01 +00:00
Update staticsitegen example to use new RoutablePage syntax
This commit is contained in:
parent
62f1020606
commit
ad2dfd81a2
1 changed files with 3 additions and 7 deletions
|
|
@ -58,21 +58,17 @@ Example:
|
|||
|
||||
.. code:: python
|
||||
|
||||
from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin
|
||||
from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin, route
|
||||
|
||||
|
||||
class BlogIndex(Page, RoutablePageMixin):
|
||||
...
|
||||
|
||||
subpage_urls = (
|
||||
url(r'^$', 'serve_page', {'page': 1}),
|
||||
url(r'^page/(?P<page>\d+)/$', 'serve_page', name='page'),
|
||||
)
|
||||
|
||||
@route(r'^$', name='main')
|
||||
@route(r'^page/(?P<page>\d+)/$', name='page')
|
||||
def serve_page(self, request, page=1):
|
||||
...
|
||||
|
||||
|
||||
Then in the template, you can use the ``{% routablepageurl %}`` tag to link between the pages:
|
||||
|
||||
.. code:: html+Django
|
||||
|
|
|
|||
Loading…
Reference in a new issue