Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-24 19:19:25

MikeTheVike
Member
Registered: 2008-06-17
Posts: 47

Images used as links don't display in Textpattern...

When this code was in my html file, it worked fine. When I copy and paste it into my Textpattern page and view that page, it doesn’t show the images, only the alt text as a link. Any ideas why this is happening? The images are in the correct folder. Thanks!

<div id=“left_column”>

<a href=”#”><img class=“column_img” src=“images/depression_1.png” alt=“Depression” /></a>

<a href=”#”><img src=“images/depression_2.png” alt=“Depression” /></a>

<a href=”#”><img src=“images/depression_3.png” alt=“Depression” /></a>

<a href=”#”><img class=“column_img” src=“images/spirituality_1.png” alt=“Spirituality” /></a>

<a href=”#”><img src=“images/spirituality_2.png” alt=“Spirituality” /></a>

<a href=”#”><img src=“images/spirituality_3.png” alt=“Spirituality” /></a>

<a href=”#”><img src=“images/spirituality_4.png” alt=“Spirituality” /></a>

</div>

Last edited by MikeTheVike (2008-06-24 19:20:18)

Offline

#2 2008-06-24 19:36:31

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Images used as links don't display in Textpattern...

src="images/depression_1.png"

This is a relative link. Try…

src="/images/depression_1.png"

instead; note the leading slash making it an absolute reference. That is assuming you’ve place your images in txp’s default image directory in the web root.

Offline

#3 2008-06-24 19:39:37

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Images used as links don't display in Textpattern...

You will need a forward slash before the images like so: /images/spirituality (or you can also use the site_url tag instead)

Offline

#4 2008-06-24 19:51:10

MikeTheVike
Member
Registered: 2008-06-17
Posts: 47

Re: Images used as links don't display in Textpattern...

Thanks for the quick responses! I tried adding a forward slash and it didn’t work, I also tried the siteurl tag like below and that didn’t work either, any more ideas?

<div id=“left_column”>

<a href=”#”><img class=“column_img” src=”<txp:site_url />images/depression_1.png” alt=“Depression” /></a>

<a href=”#”><img src=”<txp:site_url />images/depression_2.png” alt=“Depression” /></a>

<a href=”#”><img src=”<txp:site_url />images/depression_3.png” alt=“Depression” /></a>

<a href=”#”><img class=“column_img” src=“images/spirituality_1.png” alt=“Spirituality” /></a>

<a href=”#”><img src=”<txp:site_url />images/spirituality_2.png” alt=“Spirituality” /></a>

<a href=”#”><img src=”<txp:site_url />images/spirituality_3.png” alt=“Spirituality” /></a>

<a href=”#”><img src=”<txp:site_url />images/spirituality_4.png” alt=“Spirituality” /></a>

</div>

Offline

#5 2008-06-24 20:03:38

MikeTheVike
Member
Registered: 2008-06-17
Posts: 47

Re: Images used as links don't display in Textpattern...

ok, I got it working. Masa mentioned putting them in the default images folder in the root, I didn’t have them in that folder, put them in there and it worked. I had other images loaded from the css file that were not in the root images folder, and they worked, so that threw me off. Thanks!

Last edited by MikeTheVike (2008-06-24 20:04:00)

Offline

#6 2008-06-24 20:05:17

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Images used as links don't display in Textpattern...

Assuming you are using the default TXP images folder, you will need to use the TXP image id number instead of the image name.

Offline

#7 2008-06-24 20:21:37

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Images used as links don't display in Textpattern...

jstubbs wrote:

Assuming you are using the default TXP images folder, you will need to use the TXP image id number instead of the image name.

…if you uploaded them via Textpattern’s Image control, otherwise no.

Offline

#8 2008-06-24 20:23:10

MikeTheVike
Member
Registered: 2008-06-17
Posts: 47

Re: Images used as links don't display in Textpattern...

jstubbs, is that when they are uploaded from within TXP? I uploaded them through ftp and it seems to be working fine…

Offline

#9 2008-06-24 20:50:03

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Images used as links don't display in Textpattern...

MikeTheVike wrote:

jstubbs, is that when they are uploaded from within TXP?

Yes.

I uploaded them through ftp and it seems to be working fine…

Mixing your images with txp’s in the same upload directory can work – txp assigns numeric ids to it’s images – but I wouldn’t recommend it in the long run.

I keep site design related images, that are less likely to change, in a separate directory e.g. /graphics/ but use txp to handle all other images associated with posts/articles. Makes it easier to review them by browsing via the images tab in the txp backend.

Offline

#10 2008-06-24 21:41:11

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Images used as links don't display in Textpattern...

masa wrote:

Makes it easier to review them by browsing via the images tab in the txp backend.

Plus captions/alt texts/image categories.

Best of both worlds is perhaps using fpx_image_import, ftping + images in the db.

Last edited by uli (2008-06-24 21:47:44)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#11 2008-06-24 22:09:46

MikeTheVike
Member
Registered: 2008-06-17
Posts: 47

Re: Images used as links don't display in Textpattern...

Thanks everyone! I’ll keep everything in mind.

Offline

Board footer

Powered by FluxBB