Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Creating heading for all pages


  • Please log in to reply
6 replies to this topic

#1 Ubernoober13

Ubernoober13

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:02:36 AM

Posted 09 August 2013 - 12:43 PM

Alright I am sure this has already been asked and most people know how to do it but I am not sure what to do.

 

I have a header like the one on the top of this page. It has a logo and a nav bar. Is there a way to edit what is in that header or nav bar and it update on all the webpages? Currently I have the change every single page for one little thing I want to change in the nav bar. I am sure there is an easier way. 

 

Any help would be appreciated. 



BC AdBot (Login to Remove)

 


#2 Grinler

Grinler

    Lawrence Abrams


  • Admin
  • 43,718 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:01:36 AM

Posted 09 August 2013 - 12:50 PM

You can put your header in a separate file and use server side includes to include it in every other page on your site:

http://www.boutell.com/newfaq/creating/include.html

#3 Ubernoober13

Ubernoober13
  • Topic Starter

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:02:36 AM

Posted 09 August 2013 - 01:00 PM

You can put your header in a separate file and use server side includes to include it in every other page on your site:

http://www.boutell.com/newfaq/creating/include.html

So all I have to do is make a new file called header.html for example. Put the header html into that file and have it call the CSS to make sure it styles properly. Then replace where my header was in all my files with #include virtual="header.html"



#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:12:36 AM

Posted 09 August 2013 - 03:36 PM

More or less, yes.



#5 Delta16

Delta16

  • Members
  • 417 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Malta
  • Local time:08:36 AM

Posted 12 August 2013 - 06:57 AM

You could use a template, but you still have to re-do all pages but only once.

 

Then you just edit the template, and the others will be changed automatically.



#6 Ubernoober13

Ubernoober13
  • Topic Starter

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:02:36 AM

Posted 12 August 2013 - 09:34 AM

So my friend showed me a way to do it in php. I am working it out but I need to know how to save my css as a php file but it still read as css. What are the brackets used for it? Like php is <? ?>



#7 Grinler

Grinler

    Lawrence Abrams


  • Admin
  • 43,718 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:01:36 AM

Posted 12 August 2013 - 09:42 AM

Dont save the css file as a php. Save it as a css and just echo out this line in the header:

<link rel="stylesheet" type="text/css" href="<url-to-css>">


Edited by groovicus, 13 August 2013 - 01:22 PM.
Fixed code typo.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users