Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-01-11 16:02:13
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
txp doesn't want to play with some js...
Hello,
I have a question, I’ve been digging through some documentation and i’ve found one or two things but would like to get some opinions of suggestions on this.
I am currently tossing an existing site into textpattern. The thing is, this site has some custom javascript in it. textpattern doesn’t seem to like this, and the widgets are just showing up blank. Is there a way to correct this without having to rely on a plugin of sorts.
Thanks! :)
Nadine.
Offline
Re: txp doesn't want to play with some js...
TXP normally doesn’t affect the use of Javascript in a website. Is it an external JS file or embedded javascript?
Offline
#3 2009-01-11 16:08:59
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
Re: txp doesn't want to play with some js...
it is embedded. its talking to the twitter / flickr api apparently. i can probably leave it for a js person later on, but i’m just curious because i’ve seen embedded js in txp sites before and it hasn’t flaked out.
Offline
Re: txp doesn't want to play with some js...
where are you placing the js code?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#5 2009-01-11 16:24:22
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
Re: txp doesn't want to play with some js...
colak wrote:
where are you placing the js code?
oh its somewhere in the sidebar, i didn’t actually write it or put it there, I’m just tossing it into the txp system. there seems to be a lot of external files, but they look like effects for something, yeah…i know its not much help.
Offline
#6 2009-01-11 17:37:25
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: txp doesn't want to play with some js...
relative path names in page templates can get confusing.
Offline
#7 2009-01-12 17:53:14
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
Re: txp doesn't want to play with some js...
So…coming back to this. It turns out that txp doesn’t want to find the base external javascript file. I tried hard linking it to no help, and I tried this hack with just the base file: http://textpattern.org/tips/333/external-javascript-in-txp
Which also didn’t work. The thing is, this js folder has about…oh 25+ files in there, some in sub directories for various things.
I’m trying to think of other solutions. Any suggestions?
Offline
Re: txp doesn't want to play with some js...
If your javascript is directory is site.com/javascript then you should use <txp:site_url/>
for your urls like this
<script type="text/javascript" src="<txp:site_url/>javascript/myscript.js"></script>
or
<script type="text/javascript" src="/javascript/myscript.js"></script>
You will run into trouble using relative urls.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#9 2009-01-12 23:54:56
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
Re: txp doesn't want to play with some js...
Yeah neither of those solutions are working for me. Its still coming up as blank. There has to be somewhere else its choking, because I can’t believe how difficult this is. I really like this system, i use it for a lot of things, but it really, really hates external files.
Offline
#10 2009-01-13 00:05:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: txp doesn't want to play with some js...
_n wrote:
but it really, really hates external files.
I don’t think so. If you just post the code you are using now, we will probably be able to tell you how to change it.
This:
oh its somewhere in the sidebar
isn’t really helpful…
Offline
#11 2009-01-13 00:49:44
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
Re: txp doesn't want to play with some js...
Found it.
Basically i had to link all the js files in the header, not just the base js file, which is a little redundant but i guess it works. Seems if I loaded / linked the base js file into txp it didn’t want to find the other files its referencing in the directory. I’m not very technical or helpful at times, sorry! :( the external js file is huge and i wasn’t sure if the sidebar js would really help, because the issue was more the linking / directory structure.
Anyways, the sidebar code was basically this:
http://work.dunderbug.com/refresh/show.js
Thanks for all the patience and responses though. I appreciated it.
Offline
Re: txp doesn't want to play with some js...
Maybe you could edit the paths in the base js file to fix this.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline