NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

How-to Display Top Level Trac Projects

Trac 0.10 and below

Trac Interface Customization explains the general way to customize.

This how-to also assumes you already have one or several projects under one trac instance. Choose one of the projects to be the main source for templates. There should be a /path/to/trac/project/templates. Copy all of the ClearSilver templates from the default location to the main project location template directory.

For example on NCCOOS Trac, I have chosen the portal Trac Project to use for customizing NCCOOS Trac pages.

cd /var/srv/trac/nccoos/portal/templates
cp /usr/share/trac/templates/*.cs . 

Since the template directory is already there, edit both site_css.cs and site_header.cs file to contain style and top level directory information.

<?cs
##################################################################
# Site CSS - Place custom CSS, including overriding styles here.
?>
#ProjectNav {
        position: absolute;
        top: 80px;
        left: 10px;
        z-index: 1;
}

<?cs
####################################################################
# Site header - Contents are automatically inserted above Trac HTML
?>
<div id="ProjectNav">

        NCCOOS Trac Projects: <a href="http://trac.nccoos.org/" title="Available Trac Projects">Top</a> |
        <a href="http://trac.nccoos.org/portal" title="Web Portal Management Trac">Web</a> |
        <a href="http://trac.nccoos.org/platforms" title="Observing Platforms Trac">Platforms</a> |
        <a href="http://trac.nccoos.org/dataproc" title="Data Processing Trac">Processing</a> |
        <a href="http://trac.nccoos.org/visualization" title="Data Visualization">Viz</a> |
        <a href="http://trac.nccoos.org/sprints" title="Sprints Trac">Sprints</a> |
        <a href="http://trac.nccoos.org/scratch" title="Trac Sandbox">Sandbox</a> |
        <a href="http://trac.nccoos.org/windpower" title="Phase 1 -- NC Wind Power Study GIS Trac [RESTRICTED]">(Wind)</a>

</div>

Under each project edit trac.ini to point to new source templates

[trac]
templates_dir = /var/srv/trac/nccoos/portal/templates

Verify all are changed

cd /var/srv/trac/nccoos
grep templates_dir */conf/trac.ini

dataproc/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates
modeling/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates
platforms/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates
portal/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates
scratch/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates
sprints/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates
visualization/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates
windpower/conf/trac.ini:templates_dir = /var/srv/trac/nccoos/portal/templates

Except for the main project folder template, change the name of each project template directory or remove it. I used the dot-convention to hide it from view. For example,

mv templates .templates

Otherwise the main source gets overruled by the local project template site_css.cs and site_header.cs contents, unless you want it to overrule for even finer customization.

You should now have a unified navigation bar or whatever you customize in html or dynamic script.