Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-28 15:14:55

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

XML tooltips

I came across this the other day : http://www.codylindley.com/blogstuff/js/jtip/

But I really don’t want to use HTML files for the tooltips, but using XML would be much better, so say for instance you’d create a file called tooltips.xml and then store each tooltip in their and then link to the one you desire.

Anyone able to help with this? I’m guessing it would just be a case of changing the JS to grab the data from the xml file. Thanks.


~ Cameron

Offline

#2 2008-10-30 17:51:37

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: XML tooltips

anyone able to offer help


~ Cameron

Offline

#3 2008-10-30 18:56:24

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: XML tooltips

Depending on how many tooltips you had wouldn’t it be better to store the data in a database and have a php script return the requested data? I’m not sure xml is the best solution here.

Last edited by MattD (2008-10-30 18:56:41)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#4 2008-10-30 20:16:13

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: XML tooltips

Editing an XML document is far easier than a database table. x


~ Cameron

Offline

#5 2008-10-30 20:30:27

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: XML tooltips

There’s a lot of information on google about jQuery and xml. One example is here which may lead you in the direction of parsing the xml.

Here’s another one

Last edited by MattD (2008-10-30 20:32:22)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#6 2008-10-30 20:42:53

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: XML tooltips

yeah but i dont get how to change the file ive shown, to get it to NO longer link to individual html files but just ONE XML file


~ Cameron

Offline

#7 2008-10-30 21:28:05

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: XML tooltips

From glancing through the jQuery plugin it looks like the part that needs to change is
$('#JT_copy').load(url);
which is loading the tooltip with the data from the url. Replace the url parameter with the data you want to load after you’ve parsed it from the xml file.

This is my 5 minute observation.

Last edited by MattD (2008-10-30 21:28:22)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#8 2008-10-30 21:48:11

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: XML tooltips

MattD wrote:

From glancing through the jQuery plugin it looks like the part that needs to change is
$('#JT_copy').load(url);
which is loading the tooltip with the data from the url. Replace the url parameter with the data you want to load after you’ve parsed it from the xml file.

This is my 5 minute observation.

Any help with doing this would be much appreciated


~ Cameron

Offline

Board footer

Powered by FluxBB