代码之家  ›  专栏  ›  技术社区  ›  Michael

自定义跟踪:删除标准页脚

  •  1
  • Michael  · 技术社区  · 17 年前

    我们使用托管的Trac。 它使用Genshi模板。 最优雅的方式是什么?

    我凭直觉尝试了几件事,但都没有成功。

    我试过css

     <style type="text/css">
         #footer 
         {
             visibility:hidden;
         }
     </style>
    

    这没关系,除非您想使用自己的页脚(称为“#sitefooter”)。

    然后我尝试了jquery:

    <script>
     jQuery(document).ready(function($) { $("#footer").text(''); });
    </script>
    

    3 回复  |  直到 17 年前
        1
  •  2
  •   marcin    17 年前

    页脚在trac.ini中设置,这是默认值:

    [project]
    footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>
    
        2
  •  2
  •   Ben Aston    17 年前

    最优雅的方法是在下修改site.html

    /path-to-trac/projectname/templates/
    

    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" py:strip="">
    <!--! Custom match templates go here -->
    <div py:match="div[@id='footer']">
        <!-- put custom footer markup here -->
    </div>
    </html>
    

        3
  •  1
  •   Kent Fredric    17 年前

    display: none;
    margin: 0;
    padding: 0;
    

    而不是

    visibility:hidden;
    

    可见性隐藏项仍会占用空间。

    推荐文章