×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Adding a couple of tabs

Adding a couple of tabs 14 years 1 week ago #10698

  • Kate Fisher
  • Kate Fisher's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 82
  • Karma: 1
  • Thank you received: 0
Hi
I realise this is quite an unusual subject, I was wondering if its possible to add additional tabs to hotspot? Id quite like to do an experiment with creating a tab for each category (as we only have 3).

I realise this is quite off track from your hotspot program, just wondered if it was possible to add tabs for the categories we use. Pointers to the code to create tabs, and place tabs on a page is all I need I think. Ive not found mention of the hows and wheres of how tabs get on the page.

Kate

Adding a couple of tabs 14 years 1 week ago #10699

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
So basically you want to have 3 tabs for each category? And once you click them - each category should show a map?

Well, that should be possible, but you will need some coding knowledge as you will have to change javascript and php files...

Adding a couple of tabs 14 years 1 week ago #10700

  • Kate Fisher
  • Kate Fisher's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 82
  • Karma: 1
  • Thank you received: 0
If your okay to give me a couple of pointers I will have a look at the code. Ive worked with code just not as uber funky a coder as you!

Kate

Adding a couple of tabs 14 years 1 week ago #10706

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
hey Kate,
So the first place where you have to go is:
components/com_hotspots/views/all/tmpl/default.php

There you will see stuff like this:
$pane =& JPane::getInstance( 'tabs',  array('startOffset'=>0));
echo $pane->startPane( 'pane' );
echo $pane->startPanel( JText::_( 'Map' ), 'base' );

This are joomla functions that create those tabs.

This function hotspotsUtils::hs_showcategories(); give you an array with your categories.
So you may want to make a foreach and create a new tab for each of the categories in the array.

But this is the easy part.

If you look further down in the file yo uwill see <div id=map_cont"...<div id="map_canvas".... so here is where the magic starts
We replace thsoe divs with the map. So each tab you will have to make new div and then with js load different maps.

You will also have to hack the functions in media/com_hotspots/js/hotspots.js (not exactly sure for the right path to this file). And make it so that for each of those the component loads your markers.

The biggest problem with what you want to do is I believe performance. The content of the tabs is not loaded dinamically, but created while the page loads. So if you have 3 maps, then the browser will have to do more things and this will most probably show bad performance for the end user.

Adding a couple of tabs 14 years 1 week ago #10707

  • Kate Fisher
  • Kate Fisher's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 82
  • Karma: 1
  • Thank you received: 0
I only just made it into work, how early dyou guys get up? Your pointers very much appreciated I will try setting up a couple of tabs to see how that goes performance wise. Much appreciate your comprehensive notes.

Much appreciated.

Kate

Adding a couple of tabs 14 years 1 week ago #10708

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Wow, Kate perhaps you are in a different timezone :)
But yea, we normally get up around 6 -7 AM :)

Adding a couple of tabs 14 years 6 days ago #10736

  • Kate Fisher
  • Kate Fisher's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 82
  • Karma: 1
  • Thank you received: 0
Hi Daniel,
have to admit Ive wussed :/ at least until the rest of the site has been sorted out.
Times running short and Im getting the feeling theres not enough hours in the day. Definitly want to look into the multitab qiestion.

Many thanks

Kate

Adding a couple of tabs 13 years 8 months ago #11781

  • feefyou
  • feefyou's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
How would one fit in any old link into one of these tabs?
I am looking to fit in a 'contact us' tab into your beautiful component...
(I want to NOT use the normal menu structure, and would prefer to rely on your SUPERB architecture to help complete my fantasies)

Adding a couple of tabs 13 years 7 months ago #11782

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey feefyou :)
In this thread I explain step for step how to add a new tab:
compojoom.com/forum/27-hotspots/52-newbi.../9661-adding-new-tab
Read it all the way trough and you'll learn what to do.

Now on a second thought - I would not advise you to use the tab for this. In hotspots 1.1 the design of the component is going to drastically change and I think that I will move away from the tab structure. Adding new tab will be done by right clicking on the map and selecting the add hotspots option (I haven't done this yet, but this is my plan). When you click the add hotspots button you'll get an overlay that contains a map, that is centered on the place you've selected. Of course you'll be able to change this spot by typing a new street or just by moving the marker around.

If I manage to make this change the tabs will be obsolete. You'll see how all will look when I release the first alpha or beta, depending on how stable the code gets :)

Adding a couple of tabs 13 years 7 months ago #11886

  • feefyou
  • feefyou's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
Regarding menu items... How come the hotspots MENU item for 'adding a hotspot' doesn't work?

Adding a couple of tabs 13 years 7 months ago #11889

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I don't understand your question. Please start a new thread.
Daniel
  • Page:
  • 1
Time to create page: 0.127 seconds