Mobile app version of vmapp.org
Login or Join
Fox8124981

: Tab navigation and double content I have a website in which i use tabs to navigate between pages. For example, page a displays A as an active tab and B and C background tabs. If the visitor

@Fox8124981

Posted in: #Css #Html #Navigation

I have a website in which i use tabs to navigate between pages. For example, page a displays A as an active tab and B and C background tabs.
If the visitor gets to the website via page B, i also would like to display to page d, but not a and c.

Question:
I know i can just create index2 for b for example, so when the visitor gets to b from a, i display a,b,c and index1 when visitor gets to b from d for example.
Is that a bad practice? I know double content isn't good, but in which other way can i or should i approach this problem?

The tab navigation i designed uses < li > and id tag do display active tab, defined in the < body > tag.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Fox8124981

2 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel560

Each url should identify clearly a content, so depending on how much you care about usability, accessibility and related practices, you will choose one or other option.

Separated pages is the best option for many reasons, but is understandably that you want to use one and just hide content. If you choose to use one, you have easy control, as you mentioned, about the links, plus using cacheable images, the traffic is not going to be big.

If you choose to have one page, your best bet is to process the request with a server language and remove the content you don't want to show or just add what you want to show.

10% popularity Vote Up Vote Down


 

@Rivera981

You should probably be using url fragments to determine which tab gets shown. This will mean you only have a single page to work with.

A url fragment is the bit after a # symbol. For instance;
mysite.com/index.html#a http://mysite.com/index.html#b mysite.com/index.html#c
You could even use more descriptive fragment names if you wished.

Once you have these fragments in the URL you can use javascript (or jQuery) to show/hide the tabs.

The way I would construct this would be to "stack" the different tabs so they are all visible (one below the other). Then, when the page loads, use javascript to form them into the tabs and show/hide the relevant tab based on the url fragment.

The benefit is that if the visitor doesn't use javascript they will still be able to navigate the site and the page will 'jump' to the correct section automatically because of the fragment.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme