Forum Moderators: open

Message Too Old, No Replies

dreamweaver changing image source code when applying template?

         

solost

8:38 pm on Jan 21, 2004 (gmt 0)

10+ Year Member



In dreamweaver 4 I created a template. I want to apply this template to a page but when I do so dreamweaver changes the code of the image source so the images do not show up.

For example. In my template I have
<img src="../test/Templates/new_images/test_e.gif"

But when I go into a page and apply this template the code changes to:
<img src="/test/Templates/new_images/test_e.gif"

So basically its getting rid of the ..

I went to preferences and removed "Code re-writing" but it still does this?

Anyone know why its doing this?

I have done things like add another ../ to see what happens but then it does other screwy things like add /Templates to the code?

Deewebs

5:34 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



Hi

I have also experienced this. To get around it I just done a find and replace on all my images and added the ..

Would be good to find an easy fix though.

Colin

solost

6:05 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



Ya thats how I got around it but this is for a web site with hundreds of pages. And in order for me to do that I had to detach the pages form the template so the code I need to change is now in an editable region.

The only problem with that is the idea of templates is now useless :(

Deewebs

6:19 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



Hi

I was slightly more fortunate to be using just 2 templates and a database to create 200 pages of site.

C

robert adams

7:19 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



if possible, move the images folder to match what the code is calling for.

robert

Jenstar

7:48 pm on Jan 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is how the "../" works in Dreamweaver 4. You usually save your templates in the Template directory. But if you then create or modify a template that is NOT in the template directory, that "../" is telling the browser it needs to go up a directory level to find the referenced files.

For example:
www.example.com/images/ (where I have all my images)
www.example.com/Templates/ (where I have my templates)

When I create the template and save it to the directory file, the image code will look like <img src="../images/test_e.gif">, and that ../ is referencing the fact it needs to go up a level from the Templates directory to find the image directory.

Now if I create a main index file at www.example.com, the image code would be <img src="images/test_e.gif"> since it it doesn't have to go up a directory level to find the images.

The only time I have ever run into problems having to add or remove the "../" is when I have copied from one page, but pasted it into a different directory level (ie. content from [example.com...] but pasted it into [example.com...]

In your case, there seems to be an extra / right before the first directory. <img src="/test/Templates...>. Was that something you added to try and find a solution? I think if you remove the / it will work. Did it view properly in the template mode? Did you try uploading everything up to your site incase it is a weird quirk in your design view?