Update staticsitegen example to use new RoutablePage syntax

pull/1423/head
Karl Hobley 2015-06-19 10:08:37 +01:00
rodzic 62f1020606
commit ad2dfd81a2
1 zmienionych plików z 3 dodań i 7 usunięć

Wyświetl plik

@ -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