Edgewall Software
Modify

Opened 20 years ago

Closed 20 years ago

Last modified 2 years ago

#1409 closed enhancement (wontfix)

Menu Tweaking via site_menu.cs in templates

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

Description (last modified by Ryan J Ollos)

So I wanted to be able to add menu items to the menu in an easy fashion. through this might be quick and useful.

In: /usr/share/trac/templates/header.cs or whever you install it.

On line 104 you'll see:

 <ul><?cs

Change it to be:

 <ul><?cs include "site_menu.cs" ?>
 <?cs

Then go to your project's template file create a file called site_menu.cs (where site_footer.cs and site_header.cs and site_css.cs are).

Put in there something like:

<?cs
####################################################################
# Site menu - Contents are automatically inserted in the menu
?>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/">Java 1.5.0 API</a></li>

Realistically the Environment.py file should create this file with the default comment as well.

Just a little feature enhancement because I didn't find it to useful to only be able to tweak the header and footer.

Attachments (0)

Change History (4)

comment:1 by Matthew Good, 20 years ago

Resolution: wontfix
Status: newclosed

While I agree that there may be ways to make it easier to customize the look of Trac, I don't think that the Trac menu bar is the right place to be doing it.

The items in this bar each map to a Trac module, so adding external links to this bar would make the interface inconsistent.

Also, it's not practical to add hooks in every place a user may want to customize the page. Trac will support hooks where it provides the most benefit, but some customizations will always require modifying the templates.

In regards to the specific link the the Java API mentioned above, I would think that this type of information would be best stored in a Wiki page of links to useful resources.

Other items people may think about putting in the Trac menu would probably be best done with an additional navigation bar in the header. The Trac sites for Colloquy and Ruby on Rails are good examples of this.

comment:2 by Mark Rowe, 20 years ago

Severity: normalenhancement

I don't think it is a particularly good idea to provide such a specific point for extension. Such a change would solve your particular case, but would do nothing for the general case of making the look and feel more customisable. The recommended approach is to copy the template file into your Trac environment and make changes to that copy of the template.

comment:3 by Matthew Good, 19 years ago

Milestone: 0.9

comment:4 by Ryan J Ollos, 2 years ago

Description: modified (diff)

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.