How to add the Project Name in the Bug Page Title for Bugs

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
spouquet
Posts: 3
Joined: 16 Sep 2016, 17:27

How to add the Project Name in the Bug Page Title for Bugs

Post by spouquet »

Hi,

I want to find a way to add the Project Name to the Page Title when a bug is displayed from the view.php page.

Currently only the Bug ID + the Summary are displayed prior to a global 'window_title' variable from the config file.

My expectation is to have '[' + Project Name + '] ' + BugID + ': ' + Summary + ' - ' + 'window_title'

Regards

Stéphane
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to add the Project Name in the Bug Page Title for Bu

Post by atrol »

There is no configuration option and no event for it.
You would have to change source bug_view_inc.php (call of function html_page_top) to get what you want.
Please use Search before posting and read the Manual
spouquet
Posts: 3
Joined: 16 Sep 2016, 17:27

Re: How to add the Project Name in the Bug Page Title for Bu

Post by spouquet »

Hi Atrol and thanks for this response.

Are you talking about this line : html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ); ?
then how could I obtained the expected result as I am not sure I can concatenate the bug_id and the project_id strings.

Kind regards

Stéphane
spouquet
Posts: 3
Joined: 16 Sep 2016, 17:27

Re: How to add the Project Name in the Bug Page Title for Bu

Post by spouquet »

hey, happy new year 2017.
Just want to make this post refreshed as I was not able to obtain the expected result even if it sounds not so hard.
My last attempts with the provided help did not succeed into this.
thx for any help
regards
vkall
Posts: 1
Joined: 12 Jan 2017, 13:38

Re: How to add the Project Name in the Bug Page Title for Bu

Post by vkall »

It is the line you linked

Code: Select all

html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
html_page_top takes a string as parameter, so it should be possible to just concatenate the project name to the start.
I haven't tested this but try something like this:

Code: Select all

html_page_top( string_display_line( project_get_name( $t_bug->project_id ) ) . " " .  bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
Post Reply