Instead of using /taxonomy/term/123 I wanted jump menu to use the defined url aliases. (Because I'm using some special views which don't work with the internal path.)

Since this might be useful for more users here is my simple change (in jump.module):

// altered function
function jump_menu_get_taxo_options(&$options, $vid) {
  $tree = taxonomy_get_tree($vid);
  global $language;
  $lang = $language->language;
  $options['#'] = t('Choose an issue...');
  foreach ($tree as $term) {
    if ( $term->language == $lang || $term->language == '' ) {
      $options[jump_get_url_alias(taxonomy_term_path($term))] = $term->name;
    }
  }
}

// added function
function jump_get_url_alias( $src ){

    if ( $query = db_query( "SELECT * FROM {url_alias}
    WHERE src='%s'", $src ) ){

        if ( $rs = db_fetch_object( $query ) ){
            return $rs->dst;
        }
        else {
            return $src;
        }
    }
    else {

        return $src;
    }
}

Regards,
Paul

Comments

marcp’s picture

Status: Needs review » Needs work

Paul - if you are able to create a patch for this feature and submit it here it will help me test it out to see if it can get included.

khalor’s picture

StatusFileSize
new1.26 KB

I needed this functionality for a project, and sin.star's code seems to do the trick (mostly).

Here's a patch (only the 2nd time I've diff'd something, hopefully it works).

Things that need work:
Showing the active page in the Jump menu no longer works for Taxonomy
'Select an issue...' placeholder item should be configurable

khalor’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
StatusFileSize
new1.27 KB

Re-rolled patch against HEAD

nicholas.alipaz’s picture

Khalor, we won't likely be using that patch. A simple call to the database is not a way to go for this. We should utilize drupal_get_path_alias() for this.

I also suggest doing a quick read-through of the coding standards.

broon’s picture

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

Yes, Nicholas is right. Actually, I forgot about this "patch" while in the meantime already using the mentioned built-in function drupal_get_path_alias().

Regards,
Paul

nicholas.alipaz’s picture

Status: Closed (won't fix) » Active

Not sure why we're closing this, the feature should still be added even if you don't plan on writing the patch.

marcp’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

@nicholas - I'm moving this to 6.x-2.x-dev. Move it back on in to 1.x if you think it belongs there.

nicholas.alipaz’s picture

great, thanks. It isn't a bug, but a feature request, so I agree it should be moved to 2.x

khalor’s picture

Just a note that this problem can also be solved in the mean time (together with correctly selecting the active item in the jump menu) by using Taxonomy Redirect

nicholas.alipaz’s picture

global redirect could likely help too. Especially since search engines aren't going to attempt following a jump menu anyhow.

wxman’s picture

Just adding my 2cents. This worked for me, and global redirect does not seem work on the jump menu addresses. I did remove the $options['#'] = t('Choose an issue...'); line because I wanted to control that from the module admin section. Thanks for the patch.

manoloka’s picture

subscribe