| | 624 | |
| | 625 | '''TODO: explain''' |
| | 626 | |
| | 627 | Now we need to update the page templates: they no longer need the header and footer, and we'll have to include the `layout.html` file. For the inclusion, we add the namespace prefix for XInclude, and an `xi:include` element. |
| | 628 | |
| | 629 | Let's see how the template should look now for `index.html`: |
| | 630 | |
| | 631 | {{{ |
| | 632 | #!genshi |
| | 633 | <html xmlns="http://www.w3.org/1999/xhtml" |
| | 634 | xmlns:xi="http://www.w3.org/2001/XInclude" |
| | 635 | xmlns:py="http://genshi.edgewall.org/"> |
| | 636 | <xi:include href="layout.html" /> |
| | 637 | <head> |
| | 638 | <title>News</title> |
| | 639 | </head> |
| | 640 | <body> |
| | 641 | <p><a href="/submit/">Submit new link</a></p> |
| | 642 | |
| | 643 | <ol py:if="submissions"> |
| | 644 | <li py:for="submission in submissions"> |
| | 645 | <a href="${submission.url}">${submission.title}</a> |
| | 646 | posted by ${submission.username} |
| | 647 | at ${submission.time.strftime('%M/%d/%Y %H:%m')} |
| | 648 | </li> |
| | 649 | </ol> |
| | 650 | </body> |
| | 651 | </html> |
| | 652 | }}} |
| | 653 | |
| | 654 | You need to also change `submit.html` analogously. |