Besttoolbars Development network

Back to Besttoolbars main site

 

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Making The Toolbar Dynamic

 
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions
Author Message
kompressaur



Joined: 20 Jun 2007
Posts: 4

PostPosted: Wed Jun 27, 2007 5:32 pm    Post subject: Making The Toolbar Dynamic Reply with quote

Hello i hope you dont mind me posting this as im a little stuck on what to do from looking at the Advanced help manual.

I'm trying to make a toolbar that changes the main middle buttons depending on what web page it is on on my site. Say i go to the Horse Racing forum i would like for it to change so as i can add horse racing related links to the main middle section of my toolbar.

Also would this classify as being 'one of the five' toolbars i am allowed with my license or can i have it to change dynamically for each of my 18 forums (same root)

Quote:
Toolbar changing dynamically for the pages on your website:
You can use JavaScript on pages of your website to change parts of the toolbar on the fly as a user navigates across the pages on your site.
Read More: Page 39


ok lets go Page 39....

Bah i don't know how i missed this. Will i need to have an understandment of Java to make the toolbar dynamic? If so can anyone suggest any code or shortcuts for me? I just want to change a few buttons on a few different url's.

All help appreciated and thanks
Back to top
kompressaur



Joined: 20 Jun 2007
Posts: 4

PostPosted: Wed Jun 27, 2007 5:37 pm    Post subject: Reply with quote

Just found posted by Admin which might help-

You can add CustomXML to your toolbar and use javascript toolbar
method: CustomXML()

Here is an example on javascript:

Code:
if(...)
{//right url - adding buttons
MyTool.CustomXML("CustomXML1") = '<TOOLBAR><BUTTON
id="tbs_button_007132" caption="MyButton" visibility="1"
type="Split" command="MyCommand" img="52" hint="MyHint"/></TOOLBAR>';
}
else
{//not right url - remove buttons
MyTool.CustomXML("CustomXML1") = '<toolbar></toolbar>';
}


I wouldnt know what to edit in that to suit nor what to do with the edited javascript Sad
Back to top
kompressaur



Joined: 20 Jun 2007
Posts: 4

PostPosted: Wed Jun 27, 2007 5:50 pm    Post subject: Reply with quote

It looks like this is the important bit on p54 of the manual.

Code:
<script>
var MyTool = null;
function ToolBarInit (tool)
{
MyTool = tool;
}
function setname ()
{
MyTool.userName = document.all.uname.value;
MyTool.userid = document.all.uid.value;
MyTool.userpasswd = document.all.upass.value;
MyTool.Reload ();
}
</script>
<body onload="">
UserName:<input name="uname"><br>
UserPasswd:<input name="upass"><br>
Userid:<input name="uid"><br>
<Button onclick="setname()">Set variables</button>


Can anyone tell me what i should be looking at changing if i just want to change buttons for each differant url?

thanks :hope
Back to top
Admin
Site Admin


Joined: 22 Aug 2006
Posts: 1055

PostPosted: Thu Jun 28, 2007 12:08 pm    Post subject: Reply with quote

You may get the current url via tool.url and check

Please, view Javascript documentation at : http://www.besttoolbars.net/CUST/ToolbarJavascriptInterface.pdf
Back to top
kompressaur



Joined: 20 Jun 2007
Posts: 4

PostPosted: Mon Jul 02, 2007 10:28 pm    Post subject: Reply with quote

Thanks Admin. forgive me being manic it's just i spend long hours working on things i dont really understand and after about 72hrs of cigs and coffee and hair pulling.

k i'll go check out tool.url and look for the java document. Ive been doing something else since i last posted this. I'll be back no doubt Sad

thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BestToolbars.Net Forum Index -> General questions All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group

Copyright c Softomate, 2010. All Rights Reserved
Terms of Service | Privacy Policy