Edgewall Software

Changes between Version 46 and Version 47 of TracInterfaceCustomization


Ignore:
Timestamp:
Jun 23, 2007, 11:41:15 PM (17 years ago)
Author:
osimons <simon-code@…>
Comment:

Some fixes for the New Ticket intro text example for 0.11 - wrong element type, and catching too many forms.

Legend:

Unmodified
Added
Removed
Modified
  • TracInterfaceCustomization

    v46 v47  
    117117Note that this references your environment's `htdocs/style.css`.
    118118
    119 Example snippet of adding introduction text to the new ticket form:
     119Example snippet of adding introduction text to the new ticket form (hide when preview):
    120120
    121121{{{
    122122#!xml
    123 <div py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')">
     123<form py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')">
     124  <py:if test="req.environ['PATH_INFO'] == '/newticket' and (not 'preview' in req.args)">
    124125    <p>Please make sure to search for existing tickets before reporting a new one!</p>
     126  </py:if>
    125127  ${select('*')}
    126 </div>
    127 }}}
    128 
    129 If the environment is upgraded from 0.10 and a `site_newticket.cs` file already exists, it can actually be loaded by using a workaroud - providing it contains no ClearSilver processing. In addition, as only one element can be imported, the content needs some sort of wrapper such as a `<div>` block or other similar parent container. The XInclude namespace must be specified, and below is a complete example `site.html` file for this:
     128</form>
     129}}}
     130
     131If the environment is upgraded from 0.10 and a `site_newticket.cs` file already exists, it can actually be loaded by using a workaroud - providing it contains no ClearSilver processing. In addition, as only one element can be imported, the content needs some sort of wrapper such as a `<div>` block or other similar parent container. The XInclude namespace must be specified to allow includes, but that can be moved to document root along with the others:
    130132{{{
    131133#!xml
    132 <html xmlns="http://www.w3.org/1999/xhtml"
    133        xmlns:py="http://genshi.edgewall.org/"
    134        xmlns:xi="http://www.w3.org/2001/XInclude"
    135        py:strip="">
    136 
    137 <div py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')">
     134<form py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')"
     135        xmlns:xi="http://www.w3.org/2001/XInclude">
     136  <py:if test="req.environ['PATH_INFO'] == '/newticket' and (not 'preview' in req.args)">
    138137    <xi:include href="site_newticket.cs"><xi:fallback /></xi:include>
     138  </py:if>
    139139  ${select('*')}
    140 </div>
    141 
    142 </html>
     140</form>
    143141}}}
    144142