Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Jan 2014
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Creating a new page

    Hello.

    I am currently building my first website. In my navigation I have <li><a title="Photos" href="#">Photos</a></li> Atm when you click it, all it does is changing the url to www.domainname.net/# because my href is "#".

    What I want to do is the following: When you click the "Photos" link you will come to a page that looks like the "homepage" but with no content and will instead show a photostream from flickr (this I got sorted out already) the only thing I don't understand is how to create this new page and link to it.

    I'm using Filezilla so I assume that I would do something like creating a new html document that is named "photos.html", upload it to my: "public_html" folder and then change the <li><a title="Photos" href="#">Photos</a></li> to <li><a title="Photos" href="www.domainname.net/photos.html">Photos</a></li>

    Is this correct? I don't know how to create the "photos.html" file tough.. Let's just start with creating the html file and then proceed with the link to it and so on..

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,233
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Yes, you got it right. The easiest way to start would be to copy your "homepage" file over to photos.html, then change what's inside the body of photos.html to be your links to flickr.

  • Users who have thanked tracknut for this post:

    Justnotfocus (01-22-2014)

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    Quote Originally Posted by Justnotfocus View Post
    I don't know how to create the "photos.html" file tough.. Let's just start with creating the html file and then proceed with the link to it and so on..
    How did you create the index page then?
    Generally, an HTML file is just a plain text file, so you can create HTML files with whatever text editor you have. It can be as simple as Notepad (the default text editor in Windows) or TextEdit (Mac) or as advanced as MS Word or OpenOffice/LibreOffice Writer. However, in word processors like the latter ones, be aware that the file has to be saved as plain text, not formatted text!

    However, there are numerous editors that are specialized for writing code, with syntax highlighting and auto complete features, so if you are writing HTML regularly you should get one of these. For Windows the most popular free one appears to be Notepad++ and for Mac TextWrangler is a good one (I’m not familar with other Unix type systems, but I suppose neither are you, so I save the energy of recommending anything).

  • Users who have thanked VIPStephan for this post:

    Justnotfocus (01-22-2014)

  • #4
    New Coder
    Join Date
    Jan 2014
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks, im currently using sublime text 2. I tried yesterday to create a notepad text and name it photos.html but I didn't type anything inside, I just saved it empty and it stayed a text file. I think that made me confused, but thank you so much for helping me out here!

  • #5
    New Coder
    Join Date
    Jan 2014
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Another thing! Do I need to create a new stylesheet.css for the new page??

  • #6
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,233
    Thanks
    10
    Thanked 270 Times in 269 Posts
    You could have a different stylesheet for every page, but normally you want the whole site to have a similar look and feel, and using the same stylesheet on every page would be the way to do that.

    By the way, when you save a file that does not have ".txt" as a suffix from Notepad, you not only give it ".html" in the file name, but you have to change "save as type" from "text document (*.txt)" to "all files (*.*)"

  • #7
    New Coder
    Join Date
    Jan 2014
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Everything is up and running! Thank you so much! I did as you said and copied the index, renamed it and removed the content but kept the structure and design! works like a charm. The thing is now that when you press "photos" everything works like perfect but in the url it says "www.domainname.net/photos.html" I want to change that to "www.domainname.net/photos" only. Is that possible? I tried to rename the "photos.html" file inside my public_html folder to simply "photos" but that changed the whole html file into something else that looked broken, the icon changed from chrome to a blank page and it all looked very wrong.

  • #8
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,472
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    That would require an .htaccess rewrite, which is advanced stuff.

    You could create a subdirectory called "photos" and change name of "photos.html" to "index.html" in that subdirectory.

    Your links would have to change from:
    <li><a title="Photos" href="photos.html">Photos</a></li>

    To:
    <li><a title="Photos" href="photos/">Photos</a></li>

    It will go to the directory called "photos" and display "index.html" because you didn't define a page (index.html is the default).

    Doing it that way will cause some awkward things if you start creating many pages, but for just a 2 page website, it will be OK.

  • Users who have thanked mlseim for this post:

    Justnotfocus (01-22-2014)

  • #9
    New Coder
    Join Date
    Jan 2014
    Posts
    13
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Well, I wont risk anything cause im planning to make some more pages now that you guys have taught me how to It doesn't matter that much if it says "photos.html" it's kind of charming I guess.. Or well thanks anyways! Great anwsers

  • #10
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,472
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    You're new to this, so I'll just say that in the future you'll most likely be using PHP anyhow, so that will change everything. With PHP, you have one page (one script) and the content changes dynamically. This page you're seeing now is PHP. Notice the ?t=316883 in the URL. That's a variable and value being given to PHP to let it know which content (post) to display on this page.

    Everyone is using the same script (showthread.php), but we're seeing different content.

    So having a "clean" URL isn't really an issue anyhow.

    Keep plugging along and learn as you go.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •