Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Jan 2015
    Posts
    2
    Member #
    41451

    Make changes to "header" on every page of site?

    Hello,

    First time poster here and fairly new at webdesign. I'm building a site for my web-comic and while I could use wordpress or a comic hosting site I wanted to use this as an excuse to learn web design and build my site myself, even if its very basic.

    So I've more or less designed the layout of my site. Every page of the site will be the same in layout but have a different page of the comic on it. What I want is a "dynamic" header of sorts, where I can just update it once and it updates on every page of the site. Or, the same header appears on every page of the site and only the body of the site every changes. Is there a way to do this? Does my question even make sense?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    You use PHP scripting.

    But the question is, how are you currently making pages and content?

    With PHP, you put your "header" section in a file called something like "header.php".
    The footer is "footer.php".

    Then there is one script called "index.php" (your main script, or page).

    PHP puts the pieces together and "serves" the page (rendered as HTML) to the user's browser.

    So you are correct. You're only changing the 'body' of it. More specifically, you're creating text files for each page that PHP uses to build them.

    But what is a web comic? Is each page actually graphic images? Or is it like a comic book where you flip pages?

    It's hard to explain unless you've had some server-side PHP experience.


  4. #3
    Junior Member
    Join Date
    Jan 2015
    Posts
    2
    Member #
    41451
    Ah I had a feeling it would involve PHP. I have no experience at all with PHP actually haha.

    As for my webcomic, each page is actually like a comic book where you flip pages and has about 6-8 panels per page. I know its inefficient to be setting it up this way, but are there any major downsides (besides the extra time it takes) to just make a separate web page for each page of my comic book, and put "arrow" links that manually point to the next and previous page? Obviously this will cause the entire webpage to reload every time, but there isn't much else on the page besides the header which is only about 100kb.

  5. #4
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    They way I do it is split the website into several php files. Here is an example.

    Code:
    		<div id="pagewrap">
    			<div id="headerL">
    				<?php include('php/rs_general/header.php'); ?>
    			</div>
    			
    			<div id="bannerL">
    				<?php include('php/rs_index/banner.php'); ?>
    			</div>
    			
    			<div id="servicesL">
    				<?php include('php/rs_index/services.php'); ?>
    			</div>
    			
    			<div id="aboutL">
    				<?php include('php/rs_index/about.php'); ?>
    			</div>
    			
    			<div id="connectL">
    				<?php include('php/rs_general/connect.php'); ?>
    			</div>
    			
    			<div id="testimonialsL">
    				<?php include('php/rs_index/testimonials.php'); ?>
    			</div>
    			
    			<div id="footerL">
    				<?php include('php/rs_general/footer.php'); ?>
    			</div>
    		</div>
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  6. #5
    Junior Member
    Join Date
    Feb 2015
    Posts
    1
    Member #
    43507
    If you don't want to use php you can perform an Ajax get with javascript and pull an html file from somewhere. In this case however, I wouldn't necessarily pull a full html file but merely the configuration in json and use that to fill out a container.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:44 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com