By: howman
Date: 2005-11-10
Time: 04:31
|
Website structure adviceThis is maybe more of a general website structure question rather than TBS specific, but here goes.
When building a site, is it better to have you site structure like this... One index page which changes based on the GET var: http://www.yoursite.com/index.php?page=home http://www.yoursite.com/index.php?page=about http://www.yoursite.com/index.php?page=contact http://www.yoursite.com/index.php?page=page2 or like this... Multiple php pages: http://www.yoursite.com/index.php http://www.yoursite.com/about.php http://www.yoursite.com/contact.php http://www.yoursite.com/page2.php Thanks. |
||||
By: Skrol29
Date: 2005-11-10
Time: 11:43
|
Re: Website structure adviceI'm always divided on this point.
The first (with parameters) is more logical. But it becomes heavy when the page needs more parameters. And also too much parameters makes your page not saved into Google. The second (that I've choosen from tinybutstrong.com) is more simple and quickly manually written. But it needs a php file for each page or an URL Rewriting. |
||||
By: howman
Date: 2005-11-10
Time: 14:24
|
Re: Website structure adviceGlad to see I am not the only one who is divided on this point.
I like the idea of having a clean URL without all of the parameters added on. When I did it this way using TBS, I realized that all of my php pages used a lot of the same code. The only thing that was different was the choice of content. I started to think that if I ever needed to make a change to the site, I might need to edit every PHP script. When I tried doing it with one PHP script and GET vars, it worked fine until I need to create a page that had more than just basic contect, it had logic. Then the script started to get messy. Thanks for your input Skrol. |
||||
By: Skrol29
Date: 2005-11-10
Time: 14:37
|
Re: Website structure adviceIf it can help you, most of php pages if the tinybutstrong.com site are coded like this :
Only few pages are realy doing someting. I don't know yet if this is smart, but this enables me to have a global simple site. |
||||
By: howman
Date: 2005-11-10
Time: 15:27
|
Re: Website structure adviceThat does help. Thanks.
Do you use a fixed path for templates and images? For example, if you create a new page such as www.mysite.com/subfolder/coolpage.php, you would need to do:
|
||||
By: Maz
Date: 2005-11-11
Time: 15:20
|
Re: Website structure adviceFor what it's worth, I've done it this way:
In my init.php file I have:
Then I modded the TBS class slightly to:
Then, because I wanted to use a global language file in my templates, so I could just add [lang.welcome_text] for example, I added the following:
As you can see, I've also added quite a few more functions for my needs but you get the idea. |
||||
By: Maz
Date: 2005-11-11
Time: 15:23
|
Re: Website structure adviceOoops. Forgot the useage:
It means I get to use:
and
|
||||
By: howman
Date: 2005-11-11
Time: 15:51
|
Re: Website structure adviceThanks Maz. I appreciate you sharing your approach.
|