View Issue Details

IDProjectCategoryView StatusLast Update
0010034mantisbtcustomizationpublic2014-01-21 16:50
Reporterregi24 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version1.2.3 
Summary0010034: Set HTML body element ID to current page name
Description

It would be nice if Mantis would be more customizable via css stylesheets.
For example differentiate between the text style to show ID bugs and the text used in the Menu bar.

Tagspatch
Attached Files
0001-use-page-name-for-body-id.patch (1,029 bytes)   
From 3a031ebff827368aab702b7ea4a956650dfd4da8 Mon Sep 17 00:00:00 2001
From: Nick Tucker <nkjtkr+mantis@googlemail.com>
Date: Sat, 10 Jan 2009 13:41:42 +0000
Subject: [PATCH] use page name for body id

---
 core/html_api.php |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/html_api.php b/core/html_api.php
index 898160d..724ffbd 100644
--- a/core/html_api.php
+++ b/core/html_api.php
@@ -317,7 +317,8 @@ function html_head_end() {
 # --------------------
 # (8) Begin the <body> section
 function html_body_begin() {
-	echo '<body>', "\n";
+	$t_page = basename( $_SERVER['PHP_SELF'], '.php' );
+	echo '<body id="', $t_page, '">', "\n";
 
 	event_signal( 'EVENT_LAYOUT_BODY_BEGIN' );
 }
@@ -1377,7 +1378,7 @@ function html_buttons_view_bug_page( $p_bug_id ) {
 		# DELETE button
 		echo '<td class="center">';
 		html_button_bug_delete( $p_bug_id );
-		echo '</td>';		
+		echo '</td>';
 	}
 
 	helper_call_custom_function( 'print_bug_view_page_custom_buttons', array( $p_bug_id ) );
-- 
1.6.0.4

Activities

giallu

giallu

2009-01-09 10:39

reporter   ~0020562

I'm sure there are plenty of places where this need to happen so feel free to provide specific patches for the things you needs to style.

NT

NT

2009-01-10 08:50

reporter   ~0020573

I have attached a patch to give the html body tag an id of the page name.
This should make it easier use css to customise the appearance of a single page.

grangeway

grangeway

2009-01-10 19:37

reporter   ~0020578

Nick,

You'd want to apply css to one page and a different css to another? Maybe i'm missing something here, but wouldn't most people want the same style across a site :)

Anyway, iirc, we need to be careful as I thought PHP_SELF in some systems included querystring.

Paul

NT

NT

2009-01-11 04:20

reporter   ~0020579

Paul

I took the PHP_SELF from existing code in the is_page_name function, but checking again, that function is flawed, is_page_name('ogi') would return true on 'login_page' - not a problem with the current page names, but maybe this needs changing.

The main problem is that the widespread use of tables in mantis is so css unfriendly. Mantis class and id attributes are set up to style pages the way they currently only.

This change would allow restyling of some of the simpler pages especially the login_page without needing further changes the html output.
(see forum topic http://www.mantisbt.org/forums/viewtopic.php?f=4&t=6552 for a request to change the login page).

This is really a hack, as correcting the underlying problem would involve a lot of work. If that much work is going to be done should a templating system such as Smarty be used instead ?

Adding an id to the body would also allow javascript libraries (such as jQuery) to be used to make larger changes to the appearance of an individual page by altering the DOM (e.g. how about tabs on the advanced bug_view page).

Nick

dhx

dhx

2010-09-17 23:50

reporter   ~0026761

The original bug report was too vague to be of any use so I have narrowed the description down to match the body ID patch you've provided.

We'll need to sanitise the page name before printing it anywhere within the HTML.

Otherwise I like the idea of the patch :)

Related Changesets

MantisBT: master 11407dd4

2010-08-23 19:11

daryn


Details Diff
0010034 - Convert menus to lists and add css to maintain the current style. Remove
calls to print_bracket_link for the menus and use css content attribute to add the
brackets. Thanks to http://matthewjamestaylor.com/blog/beautiful-css-centered-menus-no-hacks-full-cross-browser-support
for the centered floating list styles.
Affected Issues
0010034
mod - css/default.css Diff File
mod - core/html_api.php Diff File