开发者

Building Lots of Websites - Speeding Up Process

We are building 4-6 websites a week and things are getting pretty hectic. We have a lot going on and were thinking of ways to speed it up to make it go a lot faster. We work in the automotive industry so all of our clients have very similar / the same pages. We find ourselves creating the same things over and over.

We have about 10+ pages that are standard for all of the websites, so I figured I would make a shop_info.php page that holds all of the shop variables like Shop name, Address, City, State, Zip, Phone, etc.

I also created the index page to be something like: index.php?page=about and redirected that to site/about/

So my index page looks something like this:

case "contact":
    $title_name =开发者_运维问答 "Contact Us";
    $page_content = "includes/contact.php";
    include("inner.php");
    break;
case "about":
    $title_name = "About Us";
    $page_content = "includes/about.php";
    include("inner.php");
    break;
case "index":
    include("home.php");
    break;

That way, when we just build the home page and inner page, and then all of our standard content is already plugged in, we don't have to keep creating the same pages over and over.

My first question is, does anyone have any suggestions for how I am doing this? Is this a good method? And second, I was thinking about making a form that I would use whenever I start a new website, and I would fill in the basic information that would write to a shop_info.php page and then having a Drop Down for "How many pages will this be?" And I would be able to write custom pages like "Schedule Appointment" and it would automatically create the page in the includes folder and write to the index.php and add a new "case schedule":

What do you think of that second idea? I would need a little help in going that direction, creating new files and putting them in the right folder and writing to the index file to create a new case for my switch statement.

Any help is appreciated.

Please note that these will be custom websites, they aren't dynamic template based sites - they will all have different stylesheets and HTML markup. And NO they do not need the ability to edit content.

Thank you!


The way i handled a similar situation was to have the sites share the libs / frontend scripts/ and tpls. I made a central config that had all the site info needed to populate things specific to the site like name, url, email, phone, image path that made the data available to the site you are on based on a value set for the site in the apache config. Finally the site was designed using css with the knowledge that they were essentially cookie cutter sites . Then when a new site needs to be created you just add a new site data entry and image assets dir ( which was the siteid of the site so you can build dynamically), create a new css and image assets and drop them in the sites assets. This really cut down new sites to 5 mins for me the developer. i know it improved the time for the web designers but i didnt keep track of their time.


You are working at the wrong abstraction level. Create a meta-model describing how you build those sites and populate it for your sites, generate the common parts (which is more than just templates).

Templates might provide a theoretical solution, in practice they are difficult to keep DRY. An environment like Seaside provides a much better solution. It provides a html (and a jQuery) canvas object that allows creating an object oriented model of your site and avoid duplication.


It's quite simple.

Step 1: create a template site

Step 2: create a forum

Step 3: make place holders in the template site's code

example:

Welcome to our site about cars (change it to) Welcome to our site about [#subject#]

Step 4: make a PHP file

This PHP file needs to get the information from the form to replace the placeholders placed in the template's code. Just read each file in the template directory and store in an array like array("page_name" => $content) then go through each item in the array and str_replace the placeholders with the information from the form. Then loop through the array and save the files in a new directory.

Step 5: run it, TADA

Hope this helped.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜