Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#2237 closed defect (invalid)

Trac interface customizing doesn't work

Reported by: Alesque Owned by: Jonas Borgström
Priority: normal Milestone:
Component: general Version: devel
Severity: normal Keywords:
Cc: agarino@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The content of files:

  • site_css.cs
  • site_header.cs
  • site_footer.cs

in templates directory are not added to each page.

Installation:

  • Trac 0.9b2 trunk revision [2357]
  • Windows 2003 domain server
  • ModPython (Multiple Projects)
  • pysqlite 2.0.4

Attachments (0)

Change History (4)

comment:1 by Christopher Lenz, 19 years ago

This works for me. It's also used on this very site.

Please provide more details.

comment:2 by Christopher Lenz, 19 years ago

Milestone: 0.9
Resolution: worksforme
Status: newclosed

Reopen if you can provide more details. I've really never seen this not work, and I use it a lot.

comment:3 by Alesque, 19 years ago

Resolution: worksforme
Status: closedreopened

trac.ini in conf sub directory

[wiki]
ignore_missing_pages = false

[header_logo]
src = site/logo.png
alt = xxx
height = 73
link = /
width = 236

[logging]
log_file = trac.log
log_level = DEBUG
log_type = none

[trac]
default_charset = iso-8859-15
ignore_auth_case = false
permission_store = DefaultPermissionStore
check_auth_ip = true
database = sqlite:db/trac.db
templates_dir = C:\Program Files\Python\share\trac\templates
default_handler = WikiModule
metanav = login,logout,settings,help,about
mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
repository_dir = C:\Projects\Subversion\xxx

[project]
url = /trac/xxx/
footer =  xxx
name = xxx
descr = xxx
icon = site/trac.ico

[mimeviewer]
php_path = php
enscript_path = enscript
tab_width = 8
max_preview_size = 10485760

[attachment]
max_size = 10485760

[timeline]
changeset_show_files = 0
default_daysback = 30

[diff]
tab_width = 8

[ticket]
default_version = 
default_component = Documentation
default_type = task
restrict_owner = false
default_milestone = 
default_priority = normal
default_severity = normal

[browser]
hide_properties = svk:merge

header.cs content file in "C:\Program Files\Python\share\trac\templates" directory

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><?cs
 if:project.name_encoded ?>
 <title><?cs if:title ?><?cs var:title ?> - <?cs /if ?><?cs
   var:project.name_encoded ?> - Trac</title><?cs
 else ?>
 <title>Trac: <?cs var:title ?></title><?cs
 /if ?><?cs
 if:html.norobots ?>
 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /><?cs
 /if ?><?cs
 each:rel = chrome.links ?><?cs
  each:link = rel ?><link rel="<?cs
   var:name(rel) ?>" href="<?cs var:link.href ?>"<?cs
   if:link.title ?> title="<?cs var:link.title ?>"<?cs /if ?><?cs
   if:link.type ?> type="<?cs var:link.type ?>"<?cs /if ?> /><?cs
  /each ?><?cs
 /each ?><style type="text/css"><?cs include:"site_css.cs" ?></style>
 <script type="text/javascript" src="<?cs
   var:chrome.href ?>/common/js/trac.js"></script>
</head>
<body>
<?cs include "site_header.cs" ?>
<div id="banner">

<div id="header"><?cs
 if:chrome.logo.src ?><a id="logo" href="<?cs
  var:chrome.logo.link ?>"><img src="<?cs var:chrome.logo.src ?>"<?cs
  if:chrome.logo.width ?> width="<?cs var:chrome.logo.width ?>"<?cs /if ?><?cs
  if:chrome.logo.height ?> height="<?cs var:chrome.logo.height ?>"<?cs
  /if ?> alt="<?cs var:chrome.logo.alt ?>" /></a><hr /><?cs
 elif:project.name_encoded ?><h1><a href="<?cs var:chrome.logo.link ?>"><?cs
  var:project.name_encoded ?></a></h1><?cs
 /if ?></div>

<form id="search" action="<?cs var:trac.href.search ?>" method="get">
 <?cs if:trac.acl.SEARCH_VIEW ?><div>
  <label for="proj-search">Search:</label>
  <input type="text" id="proj-search" name="q" size="10" accesskey="f" value="" />
  <input type="submit" value="Search" />
  <input type="hidden" name="wiki" value="on" />
  <input type="hidden" name="changeset" value="on" />
  <input type="hidden" name="ticket" value="on" />
 </div><?cs /if ?>
</form>

<?cs def:nav(items) ?><?cs
 if:len(items) ?><ul><?cs
  set:idx = 0 ?><?cs
  set:max = len(items) - 1 ?><?cs
  each:item = items ?><?cs
   set:first = idx == 0 ?><?cs
   set:last = idx == max ?><li<?cs
   if:first || last || item.active ?> class="<?cs
    if:item.active ?>active<?cs /if ?><?cs
    if:item.active && (first || last) ?> <?cs /if ?><?cs
    if:first ?>first<?cs /if ?><?cs
    if:(item.active || first) && last ?> <?cs /if ?><?cs
    if:last ?>last<?cs /if ?>"<?cs
   /if ?>><?cs var:item ?></li><?cs
   set:idx = idx + 1 ?><?cs
  /each ?></ul><?cs
 /if ?><?cs
/def ?>

<div id="metanav" class="nav"><?cs call:nav(chrome.nav.metanav) ?></div>
</div>

<div id="mainnav" class="nav"><?cs call:nav(chrome.nav.mainnav) ?></div>
<div id="main">

site_header.cs content file in templates sub directory project

<?cs
####################################################################
# Site header - Contents are automatically inserted above Trac HTML

<!-- interface customizing test -->

?>

Restarting Web Server (really needed ?)

Clearing the browser cache

Viewing page content (home page) of this project:

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
  [...]
</head>
<body>


<div id="banner">

Comment doesn't appear ?!? Sorry but it doesn't work for me…

comment:4 by Christopher Lenz, 19 years ago

Resolution: invalid
Status: reopenedclosed

The problem is that you are adding your stuff inside the ClearSilver comment PI. Move it after the closing ?> and it'll work.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.