Not exactly what you were asking for, but we use the following fragment to
show a corporate logo and either the site logo or the site's
name+description. Hopefully this will give you enough to get a good running
start. I suspect if you inject both the company logo and the project logo
in the "banner" match, and do not define an image/logo for the project in
your trac.ini (so that Trac renders your project name as text), you will get
pretty close to what you want.
{{{
<!--! Add the CSS necessary for the common look & feel -->
<py:match path="head" once="true">
<head>
${select('*|comment()|text()')}
<link rel="stylesheet" href="${href.chrome('site/local.css')}"
type="text/css" />
</head>
</py:match>
<py:match path="body" once="true">
<body>
<!--! Add the logo & banner background (we do the images here so that we
can make use of Trac's templating engine to construct URL's relative
to this project). -->
<div py:match="div[@id='banner']" py:attrs="select('@*')"
style="background-image:
url(${href.chrome('site/banner-back.jpg')});">
<a id="localbanner_link" href="http://corporate.url.here"><img
src="${href.chrome('site/corporate_logo.gif')}"
alt="Corporate Name" /></a>
${select('*|comment()|text()')}
</div>
<!--! If a description was defined (and the project doesn't have a
logo), add the description to the banner -->
<py:match path="div[@id='header']/h1/a" once="true">
<table height="100%"><td valign="center">
<h1><a py:attrs="select('@*')">${select('*|text()')}</a></h1>
<py:if test="project.descr">
<h2>${project.descr}<br/> </h2>
</py:if>
</td></table>
</py:match>
<py:match path="div[@id='header']/h1" once="true">
${select('*|comment()|text()')}
</py:match>
${select('*|comment()|text()')}
</body>
</py:match>
}}}
And the corresponding CSS:
{{{
/* Fix the positioning & height for the site banner */
body { margin-top: 80px; }
/* Add the blue banner and link */
#banner {
position: absolute;
top: 0;
left: 0;
width:100%;
height: 78px;
background-color:#004889;
background-repeat:no-repeat;
}
#localbanner_link {
position: absolute;
top: 0;
left: 0;
height:78px;
border: none;
}
#localbanner_link :link, #localbanner_link :visited,
#localbanner_link :link:hover, #localbanner_link :visited:hover, {
color: transparent;
background-color: transparent;
}
/* Setup the header to support both project name and description; center
the name/description on the blue banner. */
#header {
margin-top: 0;
margin-left: 175px;
margin-right: 18em;
margin-bottom: -46px;
height: 75px; /* needed to make the image centering work */
line-height: 75px; /* needed to make the image centering work */
}
#header h1, #header h2 {
background: transparent;
border: none;
padding: 0px;
margin: 2px;
}
#header h1 {
font-size: 25px;
margin-top: 8px;
}
#header h2 {
font-size: 12px;
font-family: Verdana,'Bitstream Vera Sans',Helvetica,sans-serif;
}
#header h1 :link, #header h1 :visited {
color: #ececec;
border-bottom: 1px dotted #bbb;
padding: 0px;
}
#header img {
margin: 0;
padding: 0;
vertical-align: middle;
}
}}}
Good luck,
john
On Thu, Mar 24, 2011 at 10:24 AM, Clemens Feige <[email protected]>
wrote:
> Hello.
>
> I want to create my own customized logo area in the upper left corner of
all
> Trac HTML pages.
>
> I know that the logo can be customized with the [header_logo] section in
> <trac.ini>. But this allows only one logo file. I would like more
> customization:
> 1. company logo picture
> 2. project logo picture
> 3. project name as text
>
> Next I studied
> http://trac.edgewall.org/wiki/TracInterfaceCustomization
> and related pages.
>
> I now have my own <site.html> and <style.css> files and I know that I
> somehow have to write a Genshi-match to replace the standard logo with my
> own one:
>
> <div id="header">
> my own logo stuff goes here
> </div>
>
> Who can tell me what (Genshi code?) to put in <site.html> to make my own
> logo area.
> I do not know how to catch and replace this <div id="header"> section.
> Or am I on the wrong way?
>
> This is on Trac 0.11.6 with no plugins installed. Webserver is apache.
>
> Thanks
> Clemens
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en.