View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007573 | mantisbt | bugtracker | public | 2006-11-07 08:38 | 2014-10-05 03:02 |
Reporter | rickb | Assigned To | grangeway | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Platform | Any | OS | Any | ||
Product Version | 1.0.5 | ||||
Summary | 0007573: add link elements to head of each page | ||||
Description | HTML allows for <link> elements in the header to indicate relationships from a page to several other pages. A useful way to use this is for the "previous" and "next" links to be expressed in the head (as well as via <a> links in the body of course). Please add something to the head of relevant pages that puts <link> elements in. | ||||
Additional Information | Example <link>s <link href="main_page.php" rel="Top" /> | ||||
Tags | patch | ||||
Attached Files | 7573.diff (3,402 bytes)
--- core/html_api.php Thu Jan 15 06:14:12 1970 +++ core/html_api.php Thu Jan 15 06:14:12 1970 @@ -159,8 +159,8 @@ * @param string $p_redirect_url url to redirect to if necessary * @return null */ -function html_page_top( $p_page_title = null, $p_redirect_url = null ) { - html_page_top1( $p_page_title ); +function html_page_top( $p_page_title = null, $p_redirect_url = null, $p_extra_headers = null ) { + html_page_top1( $p_page_title, $p_extra_headers ); if ( $p_redirect_url !== null ) { html_meta_redirect( $p_redirect_url ); } @@ -172,7 +172,7 @@ * @param string $p_page_title page title * @return null */ -function html_page_top1( $p_page_title = null ) { +function html_page_top1( $p_page_title = null, $p_extra_headers = null ) { html_begin(); html_head_begin(); html_css(); @@ -183,7 +183,11 @@ if ( !is_blank( $g_robots_meta ) ) { echo "\t", '<meta name="robots" content="', $g_robots_meta, '" />', "\n"; } - + if ( $p_extra_headers !== null ) { + foreach ( $p_extra_headers as $t_header ) { + echo "\t", $t_header, "\n"; + } + } html_rss_link(); $t_favicon_image = config_get( 'favicon_image' ); --- bug_view_inc.php Thu Jan 15 06:14:12 1970 +++ bug_view_inc.php Thu Jan 15 06:14:12 1970 @@ -61,14 +61,30 @@ compress_enable(); + # prev/next <head> <link> + $t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false ); + if ( $t_bugslist ) { + $t_bugslist = explode( ',', $t_bugslist ); + $t_index = array_search( $f_bug_id, $t_bugslist ); + if ( false !== $t_index ) { + if ( isset( $t_bugslist[$t_index-1] ) ) { + $t_prev_link = 'bug_view_page.php?bug_id='.$t_bugslist[$t_index-1]; + $t_head_link_arr[] = '<link rel="Prev" href="'.$t_prev_link.'" />'; + } + if ( isset( $t_bugslist[$t_index+1] ) ) { + $t_next_link = 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1]; + $t_head_link_arr[] = '<link rel="Next" href="'.$t_next_link.'" />'; + } + } + } + if ( $tpl_show_page_header ) { - html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ); + html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ), null, $t_head_link_arr ); print_recently_visited(); } $t_action_button_position = config_get( 'action_button_position' ); - $t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false ); $tpl_show_versions = version_should_show_product_version( $tpl_bug->project_id ); $tpl_show_product_version = $tpl_show_versions && in_array( 'product_version', $t_fields ); @@ -241,16 +257,12 @@ # prev/next links if ( $t_bugslist ) { echo '<td class="center"><span class="small">'; - - $t_bugslist = explode( ',', $t_bugslist ); - $t_index = array_search( $f_bug_id, $t_bugslist ); - if ( false !== $t_index ) { - if ( isset( $t_bugslist[$t_index-1] ) ) { - print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index-1], '<<' ); + if ( isset( $t_prev_link ) || isset( $t_next_link ) ) { + if ( isset( $t_prev_link ) ) { + print_bracket_link( $t_prev_link, '<<' ); } - - if ( isset( $t_bugslist[$t_index+1] ) ) { - print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1], '>>' ); + if ( isset( $t_next_link ) ) { + print_bracket_link( $t_next_link, '>>' ); } } echo '</span></td>'; | ||||
In Firefox, the <link> elements are not visible out of the box. The Link Widgets addon is needed to access them. See https://addons.mozilla.org/firefox/2933/ |
|
I don't know that linking to the next or previous issue, numerically, is useful at all. Perhaps linking to the next and previous issues in the current list of issues would be useful. But if we add <link> tags for those, I would also want <a href> tags added somewhere in the page. There's no point only making <link> tags, since I don't know of any mainstream browser that makes use of those. Adding <link> tags for issues related to the current one could be interesting. |
|
I quite agree there's not much point having numerical chaining of issues that differs from what the << >> buttons do. Because we already have << and >> links for the chain of issues in the current view, these are the links I had in mind in making my suggestion. The page layout is slightly different from one page to the next. Therefore, the << >> buttons move slightly, so clicking quickly through them takes a bit more attention - so being a bit more distracting. Having <link> equivalents for these two buttons gains the benefit for users of having buttons in one place on the UI as they step through their list of issues. |
|
I forgot we already have << and >> links on the page. In light of that, adding correspending <link> elements makes sense. |
|
I have attached a patch for Mantis 1.2.3. |
|
Great idea. Thanks for the patch too. I've queued this up for 1.3.x. |
|
Removed assignment. dhx will not contribute to this issue in near future. |
|
I think in our case, this is a case of resolving as "wont fix". For this functionality to work, from what I can tell, you'd need to add a custom plugin to any of the major browsers to use it. In addition, if I look at information from the likes of google - for example: http://googlewebmastercentral.blogspot.co.uk/2011/09/pagination-with-relnext-and-relprev.html, and i'll quote: "if you choose to include rel=”next” and rel=”prev” markup on the component pages within a series, you’re giving Google a strong hint that you’d like us to: This feels quite dangerous for a public internet indexed tracker. It could imply that every bug in the tracker is related to the first bug when indexing, which could start to have undesirable results. The original reporters rationale for adding the buttons seems to be partly due to the << >> moving when changing between pages - I think we'd probably be better fixing that - then the navigation remains consistent regardless of what browser people use. |
|