CUSTOMIZE - Ability to provide Custom CSS via a Plugin

10 views
Skip to first unread message

Ilias Lazaridis

unread,
Sep 2, 2006, 5:50:50 PM9/2/06
to Trac Users
I would like to add a left-aligned navigation CSS (see the top-most
navigation of this site as an example):

http://case.lazaridis.com/wiki/Tracking

This could be used later to add additional "metanav-left" menues.

Is there a mechanism available to provide CSS alterations via a Plugin
(something like TemplateProvider)?

If not, could a direct addition to the trac.css go into the 0.10
version of trac (non-intrusive, non-alteration, additional CSS)?

Noah Kantrowitz

unread,
Sep 2, 2006, 6:52:27 PM9/2/06
to trac-...@googlegroups.com
You can either use the site_css.cs file or the SysCssPlugin on trac-
hacks. You can look at Alec's demo Trac for the Python people for an
example of a vertical menu.

--Noah

Jeroen Ruigrok/asmodai

unread,
Sep 3, 2006, 2:53:06 AM9/3/06
to trac-...@googlegroups.com
-On [20060903 00:57], Noah Kantrowitz (kan...@rpi.edu) wrote:
>You can either use the site_css.cs file or the SysCssPlugin on trac-
>hacks. You can look at Alec's demo Trac for the Python people for an
>example of a vertical menu.

Which I based on Christopher's bitten site.

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/
I may know many things, I may be ignorant...

Ilias Lazaridis

unread,
Sep 3, 2006, 10:49:59 AM9/3/06
to Trac Users

Noah Kantrowitz wrote:
> You can either use the site_css.cs file or the SysCssPlugin on trac-
> hacks.

ok, very nice!

> You can look at Alec's demo Trac

http://python-trac.swapoff.org

> for the Python people for

http://wiki.python.org/moin/CallForTrackers

> an example of a vertical menu.

ok.

I will most possibly integrate a generic java-script vertical menu into
trac. This work is part of my website/trac unification, and will be
made available under open source.

I have updated based on your information my personal selection case
(which selects trac):

http://case.lazaridis.com/wiki/Tracking

As I can rate it, the python project's decision should become either
trac or roundup.

Is there a deadline for the decision?

Matt Good

unread,
Sep 4, 2006, 2:21:24 PM9/4/06
to Trac Users

Ilias Lazaridis wrote:
> Noah Kantrowitz wrote:
> > You can either use the site_css.cs file or the SysCssPlugin on trac-
> > hacks.
>
> ok, very nice!
>
> > You can look at Alec's demo Trac
>
> http://python-trac.swapoff.org
>
> > for the Python people for
>
> http://wiki.python.org/moin/CallForTrackers
...snip...

> As I can rate it, the python project's decision should become either
> trac or roundup.
>
> Is there a deadline for the decision?

The CallForTrackers page indicates that they'll probably make their
recommendation in October.

-- Matt Good

Ilias Lazaridis

unread,
Sep 7, 2006, 8:53:38 PM9/7/06
to Trac Users

After looking a little more at this:

I would like to create a plugin, which would provide 2 additional
menues:

1.) "projectnav" - left aligned, in the line of the "metanav" menue

This would be used e.g. for the "Project Guide" link, which is
currently within the metanav menu, see:

http://case.lazaridis.com/wiki

2.) "backnav" - left aligned, in the line of the "contextnav" menue (of
the wiki)

This could be used to add e.g. Wiki-Backlinks (e.g. from a rewritten
macro "AutoNav", which would use the "MenuProvider" functionality to
add the entries).

I could do all the implementation, but would need some hints on how to
implement the plugin in the best way (ideally in a way that would keep
the code integratable into to main trac code base).

.

--
http://lazaridis.com

Noah Kantrowitz

unread,
Sep 8, 2006, 1:59:24 PM9/8/06
to trac-...@googlegroups.com
Due to the way Clearsilver handles templating this is non-trivial. A few
options include creating the new DOM elements for the menu items and
moving them in to place in JavaScript (see the CtxtnavAddPlugin for an
example), and using a combination of a new header.cs (using the same
technique as TracTags to force its use) and a request filter to add in
the new items. A better answer is "wait until Markup" as that will allow
for things like DOM transforms on the fly.

--Noah

Ilias Lazaridis

unread,
Sep 12, 2006, 6:31:29 PM9/12/06
to Trac Users

Noah Kantrowitz wrote:
> Due to the way Clearsilver handles templating this is non-trivial. A few
> options include creating the new DOM elements for the menu items and
> moving them in to place in JavaScript (see the CtxtnavAddPlugin for an
> example), and using a combination of a new header.cs (using the same
> technique as TracTags to force its use) and a request filter to add in
> the new items. A better answer is "wait until Markup" as that will allow
> for things like DOM transforms on the fly.

The menues can be implemented with 4 lines of CSS/HTML:

http://trac.edgewall.org/ticket/3704

The Related Use Case:

http://dev.lazaridis.com/base/ticket/9

.

Ilias Lazaridis

unread,
Sep 12, 2006, 6:34:19 PM9/12/06
to Trac Users

Noah Kantrowitz wrote:
> Due to the way Clearsilver handles templating this is non-trivial. A few
> options include creating the new DOM elements for the menu items and
> moving them in to place in JavaScript (see the CtxtnavAddPlugin for an
> example), and using a combination of a new header.cs (using the same
> technique as TracTags to force its use) and a request filter to add in
> the new items. A better answer is "wait until Markup" as that will allow
> for things like DOM transforms on the fly.

The menues can be implemented with 4 lines of CSS/HTML:

Ilias Lazaridis

unread,
Sep 19, 2006, 8:58:33 AM9/19/06
to Trac Users

Implemented using ITemplateProvider, IRequestFilter and add_stylesheet

http://dev.lazaridis.com/base/changeset/51

.

Noah Kantrowitz

unread,
Sep 19, 2006, 9:22:23 AM9/19/06
to trac-...@googlegroups.com
From the looks of your code, you may want to look at how the SysCss
plugin works, it handles things a bit more flexibly.

--Noah

Ilias Lazaridis

unread,
Sep 19, 2006, 12:14:24 PM9/19/06
to Trac Users
Noah Kantrowitz wrote:
> On Sep 19, 2006, at 8:58 AM, Ilias Lazaridis wrote:
> > Ilias Lazaridis wrote:
> >> I would like to add a left-aligned navigation CSS (see the top-most
> >> navigation of this site as an example):
> >>
> >> http://case.lazaridis.com/wiki/Tracking
> >>
> >> This could be used later to add additional "metanav-left" menues.
> >>
> >> Is there a mechanism available to provide CSS alterations via a
> >> Plugin
> >> (something like TemplateProvider)?
> >>
> >> If not, could a direct addition to the trac.css go into the 0.10
> >> version of trac (non-intrusive, non-alteration, additional CSS)?
> >
> > Implemented using ITemplateProvider, IRequestFilter and add_stylesheet
> >
> > http://dev.lazaridis.com/base/changeset/51
>
> From the looks of your code, you may want to look at how the SysCss
> plugin works, it handles things a bit more flexibly.

Possibly to a later point.

For now my problem is solved.

.

Reply all
Reply to author
Forward
0 new messages