- This topic is empty.
-
AuthorPosts
-
August 3, 2010 at 9:38 pm #29835JimKuenemanMember
Not sure if this is the right place but since I am using a css template so far I may as well start here.
Can someone give me a tip/hint how to do this. I have this
http://www.mustangpeak.net/New_Website/index.html
Now I want all pages to look the same except the "center panel" where the content of the page will be different. How can I do this in a way where there is a master page and I just write the html for the center panel?
I am literate in software not html/java/css/ect so I will need much help if this gets too complicated.
Thanks for any help.
Jim
August 3, 2010 at 11:03 pm #80332doobieMemberYou’ll definitely want to use PHP. Basically, you setup the common pieces of the site in PHP files. Then, include each piece on your new page…
1 file might be "header.php" and include something like:
<!DOCTYPE html>
<head>
<title>My new haircut</title>
</head>
<body>
<div id="page-wrap">
<nav>
<!– your nav would go here –>
</nav>Then, you might have "footer.php" :
<footer>
maybe your copyright would go here…
</footer></div><!– end page-wrap–>
</body>You might also have a "sidebar.php", or whatever else.
Then on each page you create, you just include each file in the appropriate place: "page1.php"
<?php include(‘header.php’); ?>
<h1>Page 1</h1>
<section>
<article> maybe an article goes here</article>
</section><?php include(‘sidebar.php’); ?>
<?php include(‘footer.php’); ?>Of course, your server will have to be running php. If you want to develop it locally, run MAMP or WAMP or LAMP or XAMP, depending on your OS.
Make sense?
August 3, 2010 at 11:16 pm #80898JimKuenemanMemberI was afraid of that. I can fake my way through html, and muddle through css but php is a whole new adventure I am not sure I want to take right now. Maybe I should use Delphi for PHP?
Jim
August 4, 2010 at 4:08 pm #80954virtualParticipantNo that’s not what he meant, you’re not actually writing any php, just using the php includes. Using php includes is easy. Read this http://www.tutorialtastic.co.uk/tutorial/php_includes or Google for Php include.
The advantage of using the php include is that if you have 100 pages and need to change something in the navigation for example, you don’t have to update 100 pages, just the one file which contains the element you need to change. The downside is that to test locally you have to use MAMP or WAMP or XAMP depending on your platform, but you can also just upload the file and test it live.
August 4, 2010 at 5:02 pm #80992doobieMember"virtual" wrote:No that’s not what he meant, you’re not actually writing any php, just using the php includes. Using php includes is easy. Read this http://www.tutorialtastic.co.uk/tutorial/php_includes or Google for Php include.The advantage of using the php include is that if you have 100 pages and need to change something in the navigation for example, you don’t have to update 100 pages, just the one file which contains the element you need to change. The downside is that to test locally you have to use MAMP or WAMP or XAMP depending on your platform, but you can also just upload the file and test it live.
Thanks for the backup
August 5, 2010 at 12:13 am #81011JimKuenemanMemberAh, I get it. Thanks.
1) Ok this work locally but not when I upload it…..
http://www.mustangpeak.net/New_Website/index.php
any thoughts?
2) Any pointer on how to make the content align to the right of the sidebar? Can I do this with CSS?
Thanks,
JimAugust 5, 2010 at 2:21 pm #81004virtualParticipantWrite your include code like this:
<?php include(‘header.php’); ?>Make sure your include files are in the same root as the index.php
August 6, 2010 at 11:58 pm #81097JimKuenemanMemberPerfect. After a few days of reading and relearning my CSS stuff I have it working. Thanks to both of you. I have been trying to use modern techniques to update the website for a couple of year now and kept giving up.
Looks pretty good for someone who doesn’t know what he is doing
http://www.mustangpeak.net/New_Website/index.php
compared to
Jim
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.