Page 1 of 2 12 LastLast
Results 1 to 15 of 16

 

Thread: CSS new starter

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post


    Hi, always just used HTML and Frontpage but am moving into using Dreamwaver and also CSS.

    SO I have been looking at the CSS tutorials on the web and have a question that I have not been able to answer yet and I am sure someone on here can advise.

    I have many pages all with the same layout and navigation bar, the layout is 2 columns across the full width on the first row and below it is one row of three columns,

    Anyway ...........

    I will use external CSS for changes to styles etc., but can I use CSS to call up a file that has the navigation menu bar info so that if I want to change the position or add more options, there will only be one file to change.

    I know that I could do this with frames but I do NOT want to use them.

    What can I do ?

  2. #2
    accelerator's Avatar
    Online shopping rocks!

    Status
    Offline
    Join Date
    Nov 2004
    Location
    England
    Posts
    3,034
    Thanks
    54
    Thanked 183 Times in 164 Posts
    Quote Originally Posted by renamecor
    can I use CSS to call up a file that has the navigation menu bar info so that if I want to change the position or add more options, there will only be one file to change.
    The conventional way to have your navigation in one file is to use a scripting language and an include file. E.g. you could use php and have the nav in a php include file, or vb.net and have the nav in an asp.net user control.

    I am not sure whether something like this could be achieved through CSS, but would recommend the Sitepoint CSS forums at:

    http://www.sitepoint.com/forums/forumdisplay.php?f=53

    for such a query.

    Rgds

    Accelerator

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Jun 2004
    Posts
    145
    Thanks
    0
    Thanked 2 Times in 1 Post
    I would go along with accelerator regarding using include files for your navigation - its the easiest way to do what you are wanting.

    I would also recommend the book Cascading Style Sheets: Separating Presentation from Content as a really useful resource for learning about CSS.
    http://www.friendsofed.com/book.html?isbn=159059231X

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post
    OK guys, not familiar with PHP but have started learning it following your suggestion.

    An include file for the nav bar in PHP looks the way to go.

    So as stated previously, my pages are all the same, made up of tables with the left menu containing the navigation links (in a cell).

    I assume I need to replace the current HTML in that cell with a piece of PHP to call up another file (containing the new menu), if that is correct then what would the command or script be ?

    Also, the new menu file to be called, can that be HTML or does it need to be in PHP too.

    Cheers for your patience with this novice )

  5. #5
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <?php require_once('menu.php'); ?>
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  6. #6
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post
    So the menu file need to be PHP also,

    What is the PHP command/script for page links, e.g. in html it would be ;

    <a href="link_to_here">link to here</a>

  7. #7
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by renamecor
    So the menu file need to be PHP also,

    What is the PHP command/script for page links, e.g. in html it would be ;

    <a href="link_to_here">link to here</a>
    Just create a new page. Call it something like menu.php. Add the page links to the menu.php or whatever you've called as normal links. Load it into your target page with an include - the code I used in a previous reply works fine. Save the page as index.php or whatever.

    You will need a testing server to see the links in action. Either upload it to your hosting or better - run a local apache/php install on your PC
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post
    Cheers, done that but all I keep getting is a blank space where the menu.php should be.

    I included NISMO's include code into the original HTML page but that cell is now just blank.

    I had a quick look on my hosting setup and PHP is included (I am with Heart Internet).

    If anyone has the patience (with me) and a few minutes, perhpas you could have a look at my URL

    http://www.carbasics.co.uk/index_copy.php

    Cheers

  9. #9
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, I don't follow.

    I can see a whole bunch of links at the top of the page - are these the ones you are using?
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  10. #10
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post
    Yes, when I previously posted I was looking at the wrong page version, been playing with a few things and got my browser windows mixed up.

    The menu links that are in the top left should be showing up in the left-hand white cell under the website logo, that is where the include code has been put.

    How can I force it to that position ?

  11. #11
    Registered User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    426
    Thanks
    0
    Thanked 0 Times in 0 Posts
    By simply putting you include in that cell
    Travel Domains for sale: luxuryhotelparis.co.uk italytravelguide.co.uk bettertravel.co.uk america-flights.co.uk bargainairline.co.uk costaricahotel.co.uk hotelsintallinn.co.uk
    Pm me for prices.

  12. #12
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post
    that is where I put it, just checked the position in the html with a bit of plain text.

    any suggestions?

  13. #13
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post
    I have sorted the positioning, it was to do with a cel within a cell, but I also had to change the index page to a .php extension like ;

    http://www.carbasics.co.uk/index_copy.php

    It will not show up when the extension is .htm

    http://www.carbasics.co.uk/index_copy.htm

    I assume that without other changes this could cause a problem with spidering and indexing the site, is this right and if so what can I do ?

  14. #14
    Registered User

    Status
    Offline
    Join Date
    Apr 2006
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, the spiders will continue to index your content, irrespective of the file extension.
    PHP content will not show up on a page without a .php extension, but you don't hve to make any other changes.

  15. #15
    Registered User

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    225
    Thanks
    1
    Thanked 1 Time in 1 Post
    Cheers for that, what about existing inbound links and current search engine indexes that already point to the .htm, will I need to have redirects to the replacement .php pages so I don't loose traffic ?

Page 1 of 2 12 LastLast


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Table formatting with CSS
    By accelerator in forum Programming
    Replies: 5
    Last Post: 14-01-06, 12:55 AM
  2. CSS Layouts
    By vcm in forum Affiliate Marketing Lounge
    Replies: 14
    Last Post: 17-11-05, 08:19 PM
  3. CSS Image disappears in IE6
    By Kandevil in forum Programming
    Replies: 2
    Last Post: 03-02-05, 05:30 PM
  4. CSS Training
    By Jean in forum Programming
    Replies: 3
    Last Post: 05-01-05, 11:27 AM
  5. Advice re starting with php, css, etc
    By al2004 in forum Affiliate Marketing Lounge
    Replies: 7
    Last Post: 23-09-04, 11:39 PM

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2