I am building a website powered by twitter's bootstrap. I have created a landing page with menus and text. The next thing I want to do is create a About page, but what is the easiest way to create a new page with the same layout. I don't think copy and pasting the layout would be a great idea. I have used PHP includes and $_GET variables for this in the past but I wondered if there is a more elegant solution.I hope this is the place for the question and I hope somebody can help me.
Bootstrap dynamic content
php;javascript;ajax;dynamic;bootstrap
There are several ways to do what you want, here is one method that I used to use.You have your landing page complete, so I assume you have a header with the navigation menus and other information on that page, you have some content in the middle of the page, and you have a footer at the bottom.What you want to do is re-use the header and footer on all pages, and just change the content, so to do this, you could take all the code for your header and put that in a file and call it header.php. Next, do the same with your footer, again naming it footer.php. Finally, do the same thing with your content, calling it landing_page.php.Now, in your landing_page.php is where you join all the files together:<?include('header.php');...output your content here...include('footer.php');?>Now you can reuse your header and footer in other templates (about.php, etc) without copying all the header and footer code in each template.This is a very basic example, and there are lots of other techniques but this should get you pointed in the right direction.For a much more in-depth approach take a look at The No Framework Framework.