Hi there.
It would be nice to add the fragment in the table header links when using drupal's sorting abilities.

Here's the suggested new code:

    $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => 'sort='. $ts['sort'] .'&order='. urlencode($cell['data']) . $ts['query_string'], 'html' => TRUE, 'fragment'=>$cell['fragment']));

Thank you.

Comments

daniele.rosa’s picture

Issue summary: View changes

change tablesort_header to:

diff --git a/includes/tablesort.inc b/includes/tablesort.inc
index e9c2806..cb9f00e 100644
--- a/includes/tablesort.inc
+++ b/includes/tablesort.inc
@@ -143,7 +143,9 @@ function tablesort_header($cell, $header, $ts) {
$ts['sort'] = 'asc';
$image = '';
}
- $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => array_merge($ts['query'], array('sort' => $ts['sort'], 'order' => $cell['data'])), 'html' => TRUE));
+ $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => array_merge($ts['query'], array('sort' => $ts['sort'], 'order' => $cell['data'])), 'html' => TRUE
+ , 'fragment' => isset($cell['fragment']) ? $cell['fragment'] : ''
+ ));

and define table header with:
$header = array(
array('data' => t($recordheadername), 'field' => 'count','sort' => 'DESC','style'=>'text-align:center',
'fragment' => 'yourfragmenttext'),);

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.