Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-15 22:23:40

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

how do link structures work in sub-sections?

i’m using a script for my contact form to make it look prettier. but in the CSS file the person has coded it as url(image.gif), as well as the javascript file. so when the page executes, it ends up looking for site.com/contact/image.gif

you can make a folder called /contact in your ftp, but that will ruin the contact page altogether.

Offline

#2 2009-04-15 22:29:19

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: how do link structures work in sub-sections?

Stick the images in a directory such as /ui/ on your server (the name should not conflict with a section), then change the css url statements to match this, e.g. url(/ui/image.gif); (with preceding slash denoting an absolute path from the html root).


TXP Builders – finely-crafted code, design and txp

Offline

#3 2009-04-15 22:32:26

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

Re: how do link structures work in sub-sections?

Why not put the images in your images folder?

Then change the css to url(/images/shadowLowerRight.gif)


My Plugins

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

Offline

#4 2009-04-15 22:36:19

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: how do link structures work in sub-sections?

i’ve tried that(you guys are fast btw!), and then what it now does is /site.com/contact/images/shadowlowerright.gif

Offline

#5 2009-04-15 23:34:48

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: how do link structures work in sub-sections?

With a preceding slash in your url statement that should work but it looks like the prettyForms.js also sets the images in the javascript too (see variables at the top) so you may need to change it there too :-)


TXP Builders – finely-crafted code, design and txp

Offline

#6 2009-04-16 00:41:15

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: how do link structures work in sub-sections?

yeah i changed it in the js file as well.

i only know where the images ended up because in Google Chrome it shows you the broken image, and right clicked it to find out more.

Offline

#7 2009-04-16 06:30:19

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: how do link structures work in sub-sections?

yeah i changed it in the js file as well.

Did it not work then?

i only know where the images ended up because in Google Chrome it shows you the broken image, and right clicked it to find out more.

just fyi: Firebug’s (firefox plugin) network pane or Safari’s developer tools can also show you what it is not able to load and where it is trying to find them.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2009-04-16 15:25:46

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: how do link structures work in sub-sections?

no still didn’t work. i’m going to use firebug next time, thanks for the tip.

i hope this can be integrated with zem contact reborn if i ever get it working. forms are such a pain to get looking nice !

Offline

#9 2009-04-16 18:37:12

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: how do link structures work in sub-sections?

Can you post a URL or your modified JS? It’s hard to debug in the dark.

Offline

#10 2009-04-16 18:40:17

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: how do link structures work in sub-sections?

jm wrote:

Can you post a URL or your modified JS? It’s hard to debug in the dark.

sorry yes i know it’s difficult :)

js
css

Offline

#11 2009-04-16 19:10:17

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: how do link structures work in sub-sections?

js/ => /js/ for an absolute path.

Last edited by jm (2009-04-16 19:11:04)

Offline

#12 2009-04-16 21:54:02

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: how do link structures work in sub-sections?

didn’t see an html page in your links so couldn’t really get to the bottom of it. I did notice however that in your js you have /urbanscav/js/... and in your css you have /js/... which are different locations.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB