Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6104901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:53:44+00:00 2026-05-23T13:53:44+00:00

I am trying to link to a specific tab in Magento Enterprise. It seems

  • 0

I am trying to link to a specific tab in Magento Enterprise. It seems that all of the answers I’ve found don’t apply well to their method. I just need a link to the page to also pull up a specific tab. This is the code they use:

Enterprise.Tabs = Class.create();
Object.extend(Enterprise.Tabs.prototype, {
 initialize: function (container) {
    this.container = $(container);
    this.container.addClassName('tab-list');
    this.tabs = this.container.select('dt.tab');
    this.activeTab = this.tabs.first();
    this.tabs.first().addClassName('first');
    this.tabs.last().addClassName('last');
    this.onTabClick = this.handleTabClick.bindAsEventListener(this);
    for (var i = 0, l = this.tabs.length; i < l; i ++) {
        this.tabs[i].observe('click', this.onTabClick);
    }
    this.select();
},
handleTabClick: function (evt) {
    this.activeTab = Event.findElement(evt, 'dt');
    this.select();
},
select: function () {
    for (var i = 0, l = this.tabs.length; i < l; i ++) {
        if (this.tabs[i] == this.activeTab) {
            this.tabs[i].addClassName('active');
            this.tabs[i].style.zIndex = this.tabs.length + 2;
            /*this.tabs[i].next('dd').show();*/
            new Effect.Appear (this.tabs[i].next('dd'), { duration:0.5 });
            this.tabs[i].parentNode.style.height=this.tabs[i].next('dd').getHeight() + 15 + 'px';
        } else {
            this.tabs[i].removeClassName('active');
            this.tabs[i].style.zIndex = this.tabs.length + 1 - i;
            this.tabs[i].next('dd').hide();
        }
    }
}
});

Anyone have an idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:53:44+00:00Added an answer on May 23, 2026 at 1:53 pm

    I would consider modifying how the class starts up.

    initialize: function (container) {
        this.container = $(container);
        this.container.addClassName('tab-list');
        this.tabs = this.container.select('dt.tab');
    // change starts here //
        var hashTab = $(window.location.hash.slice(1));
        this.activeTab = ( this.tabs.include(hashTab) ? hashTab : this.tabs.first());
    // change ends here //
        this.tabs.first().addClassName('first');
        this.tabs.last().addClassName('last');
        this.onTabClick = this.handleTabClick.bindAsEventListener(this);
        for (var i = 0, l = this.tabs.length; i < l; i ++) {
            this.tabs[i].observe('click', this.onTabClick);
        }
        this.select();
    }
    

    Here, I have only changed how the initial tab is chosen. It checks for an URL fragment which is commonly known as a hash, if that identifies one of the tabs it is preselected. As a bonus the browser will also scroll to that element if possible.

    Then you only need to append the tab’s ID to the URL. For example you might generate the URL by;

    $productUrl = Mage::getUrl('catalog/product/view', array(
        'id' => $productId,
        '_fragment' => 'tab_id',
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context: Trying to link a tab to a specific content div on a html
I am trying to link to a specific paragraph in a website that has
I am trying to link the button with my all games in amazon app
I am trying to create a link on a page that mimicks the existing
I'm trying to add a text link to a specific tag post in Wordpress
I'm trying to mimic a reddit feature. When you link to a specific comment
Found myself trying to find a link to an official definition of this design
I am trying to create an application that posts specific information on a user's
I'm trying to set an a name to the first link with a specific
I am trying to unbind a link from all functions. When I do: $('a').unbind();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.