Joomla! Discussion Forums



It is currently Tue Nov 24, 2009 10:46 am (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 13 posts ] 
Author Message
Posted: Fri Feb 02, 2007 7:09 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri May 26, 2006 1:33 am
Posts: 45
Does anyone know if it is possible to use anchors with the Tabs and Slides Plugin? (v2.2).

IE Click on Anchor Link:
Code:
<a href="#anchor"></a>


And it takes you to Tab 2, Slide 2 where the anchor is:
Code:
<a name="anchor"></a>


Top
  E-mail  
 
Posted: Fri Feb 02, 2007 7:30 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri May 26, 2006 1:33 am
Posts: 45
I have noticed from the plugin that it has a persistence function.  This works by setting a cookie for the page, so next time you come back, it reads the cookie and remembers where you were and re-opens to that spot.

It would be nice to have that useability in a GET function, so we can attach ?tab=2&slide=3 at the end of the href, and when that page opens, it will open to tab no 2 and Slide no 3 will be opened.

Anyone know how to contact the developer for this feature?  Setting cookies is not ideal for me as if there are multiple pages with tabs on them, then multiple cookies get set.  Depending on the browser, there is a maximum number of cookies allowed, which means that this feature could block other vital cookies because it fill up the browser with so many cookies which are not vital for me.


Top
  E-mail  
 
Posted: Fri Feb 16, 2007 9:19 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sun Oct 02, 2005 4:39 pm
Posts: 190
Location: Johannesburg, South Africa
Have you tried doing this yet?

_________________
http://www.softdux.com
http://forum.softdux.com


Top
  E-mail  
 
Posted: Fri Mar 09, 2007 9:11 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri May 26, 2006 1:33 am
Posts: 45
SoftDux wrote:
Have you tried doing this yet?


Tried and failed  :(


Top
  E-mail  
 
Posted: Mon Dec 03, 2007 4:16 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 03, 2007 3:51 pm
Posts: 5
Hi All!

Well, 2.3 doesn't have an anchor system either... So I pulled up my sleeves and got busy. And I did it  ;D

Ok, firstly go to file "plugin_jw_ts.php" of the plugin, and edit the line that says:


and remove the "_comp", which means it'll become this:



Ok, save and close. Next file is "tabs_slides.js":
  • go to the line "var tabberOptions = {", look a bit lower to the "'onLoad': function(argsObj)" line. You're going to have to change that particular method to this:

      'onLoad': function(argsObj)
      {
        var t = argsObj.tabber;
        var show_type=unescape(document.location.hash.substring(1));
        var i;

        // alert('hash = ' + i);
        if ((show_type=="") || (show_type==null))
        {
            if (t.id) {
                t.cookie = t.id + t.cookie;
            }
            i = parseInt(getCookie(t.cookie));
            if (isNaN(i)) { return; }
            t.tabShow(i);
        }
        else
        {
            t.tabShowByName(show_type);
        }
        // alert('getCookie(' + t.cookie + ') = ' + i);
      },


    As you can see, this allows linking and still uses the cookie jar by default ;)
  • next, you're going to add a new method :) find "tabberObj.prototype.tabShow=function(tabberIndex)". This method is the standard show'er. Well, to still keep things neatly tight (as the code already is... probably so the javascript parser can get to business post haste :P), add the following NEW method, after the "return this;};" close line of the tabShow method:

    tabberObj.prototype.tabShowByName=function(tabberName){var i;for(i=0;i.headingText==tabberName){this.tabShow(i);break;}}return this;};

Save this file and close it! And voilá! You've got a [i]direct anchor type route to your tab! Use the exact same name in the link as of the tab.
In case your tab has spaces or special characters, use the %20 symbol. How do I know this:
http://www.thescripts.com/forum/thread535179.html

As they show in the latter thread:
http://codinginparadise.org/my_ajax_app#hello%20world

Well... I can only hope the good people at JoomlaWorks.gr have their eyes wide open.


I wanna thank everyone that allowed this to happened... couldn't have done this without you ;)


PS: If any of you guys at JoomlaWorks are reading this... I can only say that I'm a newbie at javascripting, and in about 3 hours got this up and running... so there :P Oh, and you're welcome to use this ;) And the "comp" version would be useful in the future :D eheheh


Top
  E-mail  
 
Posted: Wed Jan 21, 2009 10:57 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 03, 2007 3:51 pm
Posts: 5
Annoying forum system... can't edit my own comments... the 2 lines of code are missing, because back then I didn't know how to work this forum stuff... Ok, redited:

wyldckat wrote:
Hi All!

Well, 2.3 doesn't have an anchor system either... So I pulled up my sleeves and got busy. And I did it  ;D

Ok, firstly go to file "plugin_jw_ts.php" of the plugin, and edit the line that says:
Code:
$mosConfig_live_site/mambots/content/plugin_jw_ts/tabs_slides_comp.js


and remove the "_comp", which means it'll become this:
Code:
$mosConfig_live_site/mambots/content/plugin_jw_ts/tabs_slides.js


Ok, save and close. Next file is "tabs_slides.js":
  • go to the line "var tabberOptions = {", look a bit lower to the "'onLoad': function(argsObj)" line. You're going to have to change that particular method to this:
    Code:
      'onLoad': function(argsObj)
      {
        var t = argsObj.tabber;
        var show_type=unescape(document.location.hash.substring(1));
        var i;

        // alert('hash = ' + i);
        if ((show_type=="") || (show_type==null))
        {
            if (t.id) {
                t.cookie = t.id + t.cookie;
            }
            i = parseInt(getCookie(t.cookie));
            if (isNaN(i)) { return; }
            t.tabShow(i);
        }
        else
        {
            t.tabShowByName(show_type);
        }
        // alert('getCookie(' + t.cookie + ') = ' + i);
      },


    As you can see, this allows linking and still uses the cookie jar by default ;)
  • next, you're going to add a new method :) find "tabberObj.prototype.tabShow=function(tabberIndex)". This method is the standard show'er. Well, to still keep things neatly tight (as the code already is... probably so the javascript parser can get to business post haste :P), add the following NEW method, after the "return this;};" close line of the tabShow method:

    Code:
    tabberObj.prototype.tabShowByName=function(tabberName){var i;for(i=0;i<this.tabs.length;i++){if(this.tabs[i].headingText==tabberName){this.tabShow(i);break;}}return this;};

Save this file and close it! And voilá! You've got a direct anchor type route to your tab! Use the exact same name in the link as of the tab.
In case your tab has spaces or special characters, use the %20 symbol. How do I know this:
http://www.thescripts.com/forum/thread535179.html

As they show in the latter thread:
http://codinginparadise.org/my_ajax_app#hello%20world

Well... I can only hope the good people at JoomlaWorks.gr have their eyes wide open.


I wanna thank everyone that allowed this to happened... couldn't have done this without you ;)


PS: If any of you guys at JoomlaWorks are reading this... I can only say that I'm a newbie at javascripting, and in about 3 hours got this up and running... so there :P Oh, and you're welcome to use this ;) And the "comp" version would be useful in the future :D eheheh


edit: oh great, Now I can edit this one, but not the other one >:(


Top
  E-mail  
 
Posted: Tue Apr 28, 2009 9:52 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Apr 28, 2009 9:51 am
Posts: 4
Hello wyldckat,

Thanks for sharing this - I am modifying this for the wordpress version of this plugin from Artonesia. Fortunately the javascript is identical.

However, this only works for me if I am linking to a different page with an anchor specified on the end of the url, but not to a tab on the current page.

Did you find this too? Do you know of a work around,

Thanks!

Will


Top
  E-mail  
 
Posted: Tue Apr 28, 2009 10:42 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 03, 2007 3:51 pm
Posts: 5
Hello Will,

:eek: Never tried that... didn't need to do that before. Apparently that will only work if the browser is forced to refresh!

By what I know of javascript (which isn't very much), you'll need to create a function that is attached to url changes... a callback I think.

What also might be a good solution is for the “tabs & slides” script to search for the local page's links for references to local tabs, and attaching the “onclick” function to the url. At least it's my hunch.

Sadly, right now I don't have the time to experiment. These two ideas are the two approaches I would take if I had the time :( Sorry

If you manage to get it working, please share with the community :)
If I find the time, I'll give it a shot too!

Good luck Will!

Bruno


Top
  E-mail  
 
Posted: Tue May 12, 2009 1:43 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Apr 28, 2009 9:51 am
Posts: 4
Hi, thanks for the reply.

I couldn't think of a simple enough workaround so am not going to use it in that way. But I have used the script to direct to tabs which aren't on the same page.

Did you consider how feesable it would be to do the same for the slides part of the plug in??

Thanks, Will.


Top
  E-mail  
 
Posted: Tue May 12, 2009 2:00 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 03, 2007 3:51 pm
Posts: 5
Hello Will,

You're welcome! Too bad that the makers of Tabs & Slides haven't adapted this code to a new version... er, at least I don't think so.

As for:
Quote:
Did you consider how feesable it would be to do the same for the slides part of the plug in??

I think the slide system is very similar to the tab system, but I haven't re-checked the code to see how that part works.
If it Is similar, just compare the codes side-by-side, and do the changes/additions in a similar way.

But personally I haven't used the slides, because they had a tendency to work badly for me... but it's been over a year, so I'm not sure it they were buggy or if they visually didn't suit the website :(

If you manage to get it working, feel free to post here the working modifications ;)

Bruno


Top
  E-mail  
 
Posted: Tue May 12, 2009 2:24 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Apr 28, 2009 9:51 am
Posts: 4
Yeh it's a bit of a shame because you see lots of developers consistantly improving their plugins but this one seems to have halted some what!

It's still a good plug-in as is - I am having no problems with slides, I think playing with the speed value helps find the right comprimise beween browsers. And once restyled they don't look too bad either! (see attchment)

I will have a play with the jscript and see what I can come up with..


You do not have the required permissions to view the files attached to this post.


Top
  E-mail  
 
Posted: Tue May 12, 2009 2:45 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 03, 2007 3:51 pm
Posts: 5
:eek: Sweeeet!! It looks Excellent!! Congrats! Er, I'm supposing that work of art is yours...


Top
  E-mail  
 
Posted: Tue May 12, 2009 3:34 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Apr 28, 2009 9:51 am
Posts: 4
:-[ cheers, yup, going live next week!


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

Quick reply

 



Who is online

Users browsing this forum: moure and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group