Changes between Version 7 and Version 8 of TracInterfaceCustomization


Ignore:
Timestamp:
Jun 25, 2016, 8:15:06 PM (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracInterfaceCustomization

    v7 v8  
    9494{{{#!xml
    9595<form py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')">
    96   <py:if test="req.environ['PATH_INFO'] == '/newticket' and (not 'preview' in req.args)">
     96  <py:if test="req.path_info == '/newticket' and (not 'preview' in req.args)">
    9797    <p>Please make sure to search for existing tickets before reporting a new one!</p>
    9898  </py:if>
     
    101101}}}
    102102
    103 This example illustrates a technique of using `req.environ['PATH_INFO']` to limit scope of changes to one view only. For instance, to make changes in `site.html` only for timeline and avoid modifying other sections - use `req.environ['PATH_INFO'] == '/timeline'` condition in `<py:if>` test.
     103This example illustrates a technique of using `req.path_info` to limit scope of changes to one view only. For instance, to make changes in `site.html` only for timeline and avoid modifying other sections - use `req.path_info == '/timeline'` condition in `<py:if>` test.
    104104
    105105More examples snippets for `site.html` can be found at [trac:wiki:CookBook/SiteHtml CookBook/SiteHtml].
     
    111111<form py:match="div[@id='content' and @class='ticket']/form" py:attrs="select('@*')"
    112112        xmlns:xi="http://www.w3.org/2001/XInclude">
    113   <py:if test="req.environ['PATH_INFO'] == '/newticket' and (not 'preview' in req.args)">
     113  <py:if test="req.path_info == '/newticket' and (not 'preview' in req.args)">
    114114    <xi:include href="site_newticket.cs"><xi:fallback /></xi:include>
    115115  </py:if>