izbryte Posted December 19, 2007 Share Posted December 19, 2007 If I'm in the root folder and I want to link to an image in a folder called images the link should just be to "images/image.gif" right? All of a sudden Dreamweaver is showing it as "/images/image.gif". What's going on? Quote Link to comment https://forums.phpfreaks.com/topic/82387-solved-why-is-dreamweaver-putting-a-in-front-of-all-my-relative-links/ Share on other sites More sharing options...
helraizer Posted December 20, 2007 Share Posted December 20, 2007 It's perfectly fine, it'll work both ways. If you treat your root folder as your website. Such as www.mysite.com, if you keep the link as images/image.gif logically it would turn out as www.mysite.comimages/image.gif but that won't happen because if you type in a URL as www.mysite.com once it has loaded you'll see it as www.mysite.com/ so if you add the "/" you are doing that for it, so you'll get the same result both ways: www.mysite.com/images/images.gif. Sam Quote Link to comment https://forums.phpfreaks.com/topic/82387-solved-why-is-dreamweaver-putting-a-in-front-of-all-my-relative-links/#findComment-419620 Share on other sites More sharing options...
Malevolence Posted December 29, 2007 Share Posted December 29, 2007 Yep; It seemed to mess up my links... There are 3 ways to make relative links: yourpage.htm /yourpage.htm ./yourpage.htm The last one is the one I use most frequently because it also allows you to go BACK a directory RELATIVELY speaking... For example: if you had a file in 'folder1' and you wanted to relatively link to a file at the same level as folder 1 in 'folder2', it'd look like this: ../folder2/file.htm You can use as many dots as you like depending on how far back you'd like to go. That's all there is to it! Good Luck, Malev. Quote Link to comment https://forums.phpfreaks.com/topic/82387-solved-why-is-dreamweaver-putting-a-in-front-of-all-my-relative-links/#findComment-425548 Share on other sites More sharing options...
izbryte Posted December 29, 2007 Author Share Posted December 29, 2007 I understand how the relative links work but sometimes as a designer I create a specified folder for my clients. So it's like mySite/theirFolder/theirFile.htm Dreamweaver is adding that "/" in front of everything and when I upload files they aren't showing up right. I have to manually go back into the page and delete every "/" that is in front of a relative link! I've been doing this for years with Dreamweaver Mx 2004 and this has just happened all of a sudden. I must have changed some option not realizing it in Dreamweaver. How can I change it back so there's no "/" in front of the links? ARRRGGG! ... (lol) Quote Link to comment https://forums.phpfreaks.com/topic/82387-solved-why-is-dreamweaver-putting-a-in-front-of-all-my-relative-links/#findComment-425559 Share on other sites More sharing options...
Malevolence Posted December 30, 2007 Share Posted December 30, 2007 That's what I'm trying to say. Instead of typing 'index.htm' initially, just type ./index.htm. Dreamweaver doesn't change ./ relative links.... I too had the problem of it changing from index.htm to /index.htm which was pretty annoying. Also, if you type say 'index.htm' into the 'link' box in dreamweaver; it's better if you type <a href="index.htm">text</a> rather than doing it through the WYSIWYG (WhatYouSeeIsWhatYouGet) editor. Also, if you click the little folder icon in the properties tab next to link and the target button, there is a dropdown menu at the bottom of the dialogue saying 'Relative To:' and you can choose 'Site Root' or 'Document'. You'll probably want to select Site Root. Working yet? Quote Link to comment https://forums.phpfreaks.com/topic/82387-solved-why-is-dreamweaver-putting-a-in-front-of-all-my-relative-links/#findComment-425750 Share on other sites More sharing options...
izbryte Posted December 30, 2007 Author Share Posted December 30, 2007 Also, if you click the little folder icon in the properties tab next to link and the target button, there is a dropdown menu at the bottom of the dialogue saying 'Relative To:' and you can choose 'Site Root' or 'Document'. You'll probably want to select Site Root. That worked. It was set relative to the site root. When I changed it to document it dropped the "/". Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/82387-solved-why-is-dreamweaver-putting-a-in-front-of-all-my-relative-links/#findComment-426077 Share on other sites More sharing options...
Malevolence Posted December 30, 2007 Share Posted December 30, 2007 Lol, It got pretty annoying for me too; though now I prefer to type my own code as I've progressed in skill and realised that WYSIWYG Editors limit your creativity although they're handy if you're a beginner or if you're short for time. I still use Dreamweaver to type my own code as I like the Colour Coding and Syntax Corrections. By the way; I was wrong about something. If you would like to go 2 folders up, you do NOT add an extra dot, but you add ../ to the preexisting relative link. EG: If you wanted to access a file but it was UP by 2 folders and in a different folder and the name of the file is bob.jpg, you'd do it like this: ../../diffolder/bob.jpg so if it was 3 folders back: ../../../diffolder/bob.jpg I learned that when I was having troubles today. Regards, Dan. Quote Link to comment https://forums.phpfreaks.com/topic/82387-solved-why-is-dreamweaver-putting-a-in-front-of-all-my-relative-links/#findComment-426106 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.