i would like to have a css class for the link which has the current sorted header.

This is a rather simple change

before:
<a class="active"></a>

after:
<a class="active-sort active"></a>

Comments

merlinofchaos’s picture

In Drupal, 'active' has a slightly different meaning, though, which is why this is using active-sort. I'm not sure if this is really a good idea.

dawehner’s picture

perhaps it could be current-sort

in the current status, there is no way to use css for the current sort header in views tables

merlinofchaos’s picture

What's wrong with th.active a and td.active a?

dawehner’s picture

puh thats long ago :)

i think the problem was, that every normal active link on the site has this class too, for example the menu item from the current page.

merlinofchaos’s picture

Status: Needs review » Closed (won't fix)

Yes, though that's also the default for tablesort. I try not to have Views diverge too much from that so that Views tables don't look different from normal Drupal system tables.

BarisW’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Closed (won't fix) » Active

@merlinofchaos: I believe this is still a valid issue in 7.x. It is not possible to style the current sorted column header differently, as all links have the class 'active'. IF the th or td has a class 'active' (as suggested in #3) this would be fine too, but as far as I can see, no th/td has the class 'active'.

Any thoughts?

dawehner’s picture

For me the table itself has the needed active class on the right column, so this seems to be a fixed for me.

<tr>
                  <th class="views-field views-field-title">
            <a href="/d7/testestest?order=title&amp;sort=asc" title="sort by Title" class="active">Title</a>          </th>
                  <th class="views-field views-field-nid active">
            <a href="/d7/testestest?order=nid&amp;sort=desc" title="sort by Nid" class="active">Nid<img typeof="foaf:Image" src="http://www/d7/misc/arrow-desc.png" width="13" height="13" alt="sort descending" title="sort descending"></a>          </th>
              </tr>