One Header, Footer and Sidebars For Whole Website

Discussion in 'HTML & Website Design' started by @SHFAQ, Oct 27, 2009.

  1. #1
    I wanna design a website template but wanna know how to include one header, footer and sidebars on whole website ?
    I want to make a file for header, one file for footer and so one file for right sidebar and one file for left sidebar. Now every time i need to change anything in header or footer or sidebar, i will just change that one file for example header file and it should be changed on whole site.

    I now i can do it by php include command but is it safe for seo ? as if i use include command for header, footer, right sidebar and left sidebar then every page will have four include.

    So will anyone plz tell me is there any way other than include and ifram ? and if i use many include on every page of website is it ok for seo ?

    Hope you understand what i wanna ask and will help. Thanks
     
    @SHFAQ, Oct 27, 2009 IP
  2. danfelbm

    danfelbm Member

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Hello SHFAQ.

    Here you can find enough info:
    http:// forums digitalpoint com/showthread.php?t=390

    I hope it helps.
     
    danfelbm, Oct 27, 2009 IP
  3. youngone324

    youngone324 Peon

    Messages:
    125
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you must do it in php

    <?php include 'header.php';?>
    <?php include 'sidebar.php';?>
    <?php include 'footer.php';?>
     
    youngone324, Oct 27, 2009 IP
  4. Pyrokinetic

    Pyrokinetic Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    like LightGraphicz said, PHP include(); would be the best way to do it, I'd also suggest you learn PHP, it takes a few hours to get the hang of it, but once you do, it'll make EVERYTHING you ever do with websites easier.
     
    Pyrokinetic, Oct 27, 2009 IP
  5. allenlinkmaster

    allenlinkmaster Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    first you design a website then, slice and cut into xhtml with css then, it moves to PHP, do programming then upload your website, then check your xhtml in validator, then test for seo, this are the steps, you can edit your website after upload to according to seo, few things main for seo, title tag, keywords, description, anchor tags, careful about this, and your site must be very light, if you are making flash website then your site must be under 35 - 40 kb and if its normal website then it must be 20-25 kb, i'm talking about home page file size. good luck !!
     
    allenlinkmaster, Oct 27, 2009 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Here's another good thread, read Dan Schulz' posts: http://forums.digitalpoint.com/showthread.php?t=223056

    Includes do not affect SEO at all. What your browser sees as far as HTML is what the bots see. They don't know how it got there, so it doesn't matter.

    Dan also addresses security a bit in that thread.
     
    Stomme poes, Oct 28, 2009 IP
  7. forextrendalerts

    forextrendalerts Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I have already read module docs and developed a hello_world module. The problem is I see left and right blocks and header-footer too. For example this module should print a demo javascript page, means just module content should transferred to browser nothing from blocks etc. I dont want to disable blocks or change template for whole site.

    ie: I want to prevent that ..< html >< head >... appears twice on that page


    <html>
    <head>
    ... some js for test
    </head>
    <body>
    ... some demo code
    </body>
    </html>
     
    forextrendalerts, Oct 28, 2009 IP
  8. @SHFAQ

    @SHFAQ Well-Known Member

    Messages:
    257
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #8
    Thanks all guys for really helpfull reply as i already now how to use include command but i was in dout that is it good for seo and now you clear it that seo has no pain with includes. Thanks again

    Now will anyone plz tell me from where to start learning CSS from beginner to advanced, i now w3schools but i need something start simple to advanced and also which software is good to learn and implement CSS ?
     
    @SHFAQ, Oct 28, 2009 IP
  9. rogan4567

    rogan4567 Active Member

    Messages:
    103
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #9
    Using a template system can affect SEO indirectly. I've worked on quite a few websites where the owners use a template file (or template files) but don't allow for unique page titles or meta descriptions (not that description tags help with seo...)


    I'm assuming that php and perl are the same in this respect, but if I'm wrong, somebody can correct me.... In the template file, you should at least make it so that your titles are unique. I do this by using a variable in the header file --

    
    <html>
    <head>
    <title>$META_TITLE</title>
    <meta name="description" content="$META_DESCRIPTION" />
    <style type="text/css" href="css.css" />
    </head>
    <body>
    
    Code (markup):
    and then when I call the header, I define the variable before calling (including) the header:

    
    $META_TITLE = "Your Title Goes Here";
    $META_DESCRIPTION = "Your meta description goes here";
    
    &header; # like the <?php include 'header.php';?>
    
    Code (markup):
    Somebody who knows php should show you how to do this properly, though, if you're using php. I'm pretty sure that you can use template files for any server-side language, though -- Php, Perl, Asp, Python, etc.
     
    rogan4567, Oct 28, 2009 IP
  10. @SHFAQ

    @SHFAQ Well-Known Member

    Messages:
    257
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #10
    You have pointed a very good issu rogan4567.
    For example i have one main page to hold contents and two static include pages named: Header and Footer
    Now what to do that search engines only crawl main page title, description and tags and dont get include files titles and description ?
     
    @SHFAQ, Oct 28, 2009 IP
  11. rogan4567

    rogan4567 Active Member

    Messages:
    103
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #11
    If you're setting it up like I have outlined, the page title and meta description is only in the page that search engines access (your content page / home page). I'm below a php newbie, but I put this together to show you how it works. This may not be efficient, it may be in secure... I don't know...

    Header.php:

    
    <?php
    $HeaderFile = <<<HEADERFILE
    <html>
    <head> 
    <title>$META_TITLE</title>
    <meta name="description" content="$META_DESCRIPTION">
    </head>
    <body>
    HEADERFILE;
    echo $HeaderFile;
    ?> 
    
    Code (markup):
    Index.php
    
    <?php  
    
    $META_TITLE = "My Meta Title";
    $META_DESCRIPTION = "My Meta Description";
    
    include 'header.php'; 
    
    ?>
    This is the HTML BODY
    </body>
    </html>
    
    Code (markup):
    This will result in a web page with the code looking like this to search engines / people (if they view the source code)

    index.php executed in a browser:

    
    <html>
    <head> 
    <title>My Meta Title</title>
    <meta name="description" content="My Meta Description">
    </head> 
    
    
    
    
    
    <body>
    This is the HTML BODY
    </body>
    </html>
    
    Code (markup):
    Search engines won't know anything about your header.php or footer.php, they are invisible for all intents and purposes. If you want to have multiple web pages, though, all with different titles and meta descriptions, just use this:

    
    <?php  
    
    $META_TITLE = "My Meta Title";
    $META_DESCRIPTION = "My Meta Description";
    
    include 'header.php'; 
    
    ?>
    Code (markup):
    instead of this:

    
    <?php include 'header.php';?>
    
    Code (markup):

    But you'll have to modify the header.php to suit your needs, of course.

    Hopefully this helped as I'm not totally sure that I understood your last question.
     
    rogan4567, Oct 28, 2009 IP
  12. @SHFAQ

    @SHFAQ Well-Known Member

    Messages:
    257
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #12
    Thanks rogan4567 dear for really helpfull reply but i cant understand some code plz explain it.

    In header file you add this code and i dont know its meaning.
    $HeaderFile = <<<HEADERFILE
    Code (markup):
    I also dont want that search engines get anything from include files but what if i want then search engine get data from my include left menu ?
     
    @SHFAQ, Oct 29, 2009 IP
  13. forextrendalerts

    forextrendalerts Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I have already read module docs and developed a hello_world module. The problem is I see left and right blocks and header-footer too. For example this module should print a demo javascript page, means just module content should transferred to browser nothing from blocks etc. I dont want to disable blocks or change template for whole site.

    ie: I want to prevent that ..< html >< head >... appears twice on that page


    <html>
    <head>
    ... some js for test
    </head>
    <body>
    ... some demo code
    </body>
    </html>
     
    forextrendalerts, Oct 30, 2009 IP