Edgewall Software

Changes between Version 14 and Version 15 of GenshiTutorial


Ignore:
Timestamp:
Aug 29, 2007, 2:38:34 PM (17 years ago)
Author:
cmlenz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GenshiTutorial

    v14 v15  
    600600    <head py:attrs="select('@*')">
    601601      <title py:with="title = list(select('title/text()'))">
    602         <py:if test="title">${title} –</py:if> geddit
     602        geddit<py:if test="title">: ${title}</py:if>
    603603      </title>
    604604      <link rel="stylesheet" href="/media/layout.css" type="text/css" />
     
    622622</html>
    623623}}}
     624
     625'''TODO: explain'''
     626
     627Now 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
     629Let'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
     654You need to also change `submit.html` analogously.