Custom Main Menu item and inherited conf

41 views
Skip to first unread message

Markus Rosjat

unread,
Feb 21, 2022, 5:44:44 AM2/21/22
to trac-...@googlegroups.com
Hi all,

I have a few 'tracs running that have there own trac.ini but inherit a few things from a global config.

So in the global config i define my mainnav under [trac] and tha works just fine, Now i want to add a custom menu item in one of my tracs and define it in the local trac.ini  of the project

cloud = enable
cloud.order = 1.0
cloud.label = Nextcloud
cloud.permission = TRAC_ADMIN

so now i want to show up but since i inherit the mainnav form the global conf its not showing.
I try to redefine my mainnav entry in the local ini under [trac] but it doesnt work my new item isnt rendered.

so questions are:

- can i extend mainnav from an inherited conf ?
- If its possible, how ?

Cheers

Markus 

RjOllos

unread,
Feb 22, 2022, 11:24:12 AM2/22/22
to Trac Users
Which Trac version are you running? I think we added the ability for the code to merge config-sections from a parent, but I'll have to check if/when that was done. 

Markus Rosjat

unread,
Feb 22, 2022, 11:36:16 AM2/22/22
to trac-...@googlegroups.com
hi,

I am running 1.4.2 here

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/c2324b98-de70-4d29-a5e3-18e847c3e32en%40googlegroups.com.

RjOllos

unread,
Apr 9, 2022, 12:43:22 PM4/9/22
to Trac Users
On Tuesday, February 22, 2022 at 8:36:16 AM UTC-8 markus...@gmail.com wrote:
hi,

I am running 1.4.2 here

I tested with Trac 1.4-stable. The [ticket-custom] section of the inherited config file is merged with the base config.

trac.ini:

[inherit]
file = parent.ini

[ticket-custom]
datetime2 = time

parent.ini:

[ticket-custom]
datetime = time
parents = text
parents.label = Parent tickets
project.options =

 

Markus Rosjat

unread,
Apr 9, 2022, 12:46:46 PM4/9/22
to trac-...@googlegroups.com
Hey,

Well i want to show a Menu item not a custom field in a Ticket. I know that this works since i use custom fields in Tickets. 

Cheers

Markus

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.

RjOllos

unread,
Apr 9, 2022, 12:58:13 PM4/9/22
to Trac Users
On Saturday, April 9, 2022 at 9:46:46 AM UTC-7 markus...@gmail.com wrote:
Hey,

Well i want to show a Menu item not a custom field in a Ticket. I know that this works since i use custom fields in Tickets. 

Cheers

Markus

You can't extend [trac] mainnav, but you can override it. This should definitely work:

RjOllos

unread,
Apr 9, 2022, 1:00:58 PM4/9/22
to Trac Users
Oh wait, sorry I forgot that we replaced [trac] mainnav  with the [mainnav] section.  There's not [trac] mainnav option in Trac in Trac 1.4.

The mainnav items are fully defined through the mainnav section.

Markus Rosjat

unread,
Apr 9, 2022, 1:02:19 PM4/9/22
to trac-...@googlegroups.com
Yeah but then I will leave it since it will cause to much redundance.

Thanks for the Info

Cheers

Markus

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.

RjOllos

unread,
Apr 9, 2022, 1:05:43 PM4/9/22
to Trac Users
On Saturday, April 9, 2022 at 10:02:19 AM UTC-7 markus...@gmail.com wrote:
Yeah but then I will leave it since it will cause to much redundance.

Thanks for the Info

Cheers

Markus

I might be missing your point, but you can define the options for [mainnav] shared among all of your Trac instances in the parent.ini and then override or extend those options in the base trac.ini.

If you have this in [mainnav] of your trac.ini:
cloud = enable
cloud.order = 1.0
cloud.label = Nextcloud
cloud.permission = TRAC_ADMIN

It should get merged with the [mainnav] from the inherited config file.

Markus Rosjat

unread,
Apr 9, 2022, 1:10:30 PM4/9/22
to trac-...@googlegroups.com
Its the other way around, this is my section in one of my project ini files that inherites tue Main ini file . But as i explained this doesnt seem to work

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.

RjOllos

unread,
Apr 9, 2022, 1:28:33 PM4/9/22
to Trac Users
On Saturday, April 9, 2022 at 10:10:30 AM UTC-7 markus...@gmail.com wrote:
Its the other way around, this is my section in one of my project ini files that inherites tue Main ini file . But as i explained this doesnt seem to work

I don't know if I'm just not getting what you are saying, but I did some testing and [mainnav] inheritance seems to work fine.

Markus Rosjat

unread,
Apr 9, 2022, 1:32:04 PM4/9/22
to trac-...@googlegroups.com
No worries, if you like just Post the Part of the Main ini and the Part of the ini that inherites from it and the externes the mainnav there. I guess then i can figure it out

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.

RjOllos

unread,
Apr 9, 2022, 2:35:38 PM4/9/22
to Trac Users
On Saturday, April 9, 2022 at 10:32:04 AM UTC-7 markus...@gmail.com wrote:
No worries, if you like just Post the Part of the Main ini and the Part of the ini that inherites from it and the externes the mainnav there. I guess then i can figure it out

I put the default in the parent.ini:
[mainnav]
admin.order = 8.0
browser.order = 4.0
newticket.order = 6.0
roadmap.order = 3.0
search.order = 7.0
tickets.order = 5.0
wiki.order = 1.0

Then in the project trac.ini
[mainnav]
wiki.order = 3.1
timeline.order = 0.1

And wiki.order from the project overrides the parent, and timeline extends it, so the ordering for TRAC_ADMIN is:

Screen Shot 2022-04-09 at 11.33.18.jpg

But removing [mainnav] from the project trac.ini yields:

Screen Shot 2022-04-09 at 11.33.31.jpg

Markus Rosjat

unread,
Apr 9, 2022, 2:39:25 PM4/9/22
to trac-...@googlegroups.com
Yeah thats how i do it just with a custom Henry but mine doesnt get displayed. I guess this only works for Standard items like the one in your example.

Thanks for the example 

Cheers 

Markus

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.

RjOllos

unread,
Apr 9, 2022, 3:02:21 PM4/9/22
to Trac Users
On Saturday, April 9, 2022 at 11:39:25 AM UTC-7 markus...@gmail.com wrote:
Yeah thats how i do it just with a custom Henry but mine doesnt get displayed. I guess this only works for Standard items like the one in your example.

Thanks for the example 

Cheers 

Markus

So I think you just have a typo, s/enable/enabled.

cloud = enabled
 
Screen Shot 2022-04-09 at 12.01.40.jpg

Markus Rosjat

unread,
Apr 9, 2022, 3:32:21 PM4/9/22
to trac-...@googlegroups.com
Yeah it seems the typo was the Problem changed enable to enabled.

Cheers

Markus

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages