Common layout in pages
Posted: Mon Aug 17, 2009 11:27 pm
So I looked all over the place on google and whatever and I've found many links relating to layouts which I'm pretty familiar with, but nowhere did I find how to actually have a common layout in all pages without recoding it for each page.
Basically I want a sidebar and all those basic things, and the actual content to appear in a div taking up the right side of the page. So I can create an index.html where I code all of this, and then I click a link and I have to recode this entire layout again on the other page.
I've done some work with Ruby on Rails which isn't totally my favorite thing in the world but it was work. Now I'm trying to make a personal site with PHP. Anyway in Ruby on Rails you could define a layout for use by pages and a certain div in the layout would hold the content while the layout itself was the entire HTML document containing the head, title, sidebars, footers, all that.
Is there some nice clean way to do this with HTML/ Javascript/ PHP/ whetever else non Ruby on Rails related?
I'd prefer to start coding the site without too much PHP server side stuff yet and work my way into it eventually, but if this definitely requires some PHP then sure... I'll do it. I'm very familiar with HTML and CSS, pretty familiar with Javascript, and barely familiar with PHP except for how I like how some of the function names remind me of C.
Basically I want a sidebar and all those basic things, and the actual content to appear in a div taking up the right side of the page. So I can create an index.html where I code all of this, and then I click a link and I have to recode this entire layout again on the other page.
I've done some work with Ruby on Rails which isn't totally my favorite thing in the world but it was work. Now I'm trying to make a personal site with PHP. Anyway in Ruby on Rails you could define a layout for use by pages and a certain div in the layout would hold the content while the layout itself was the entire HTML document containing the head, title, sidebars, footers, all that.
Is there some nice clean way to do this with HTML/ Javascript/ PHP/ whetever else non Ruby on Rails related?
I'd prefer to start coding the site without too much PHP server side stuff yet and work my way into it eventually, but if this definitely requires some PHP then sure... I'll do it. I'm very familiar with HTML and CSS, pretty familiar with Javascript, and barely familiar with PHP except for how I like how some of the function names remind me of C.