Hello Daniweb,

I'm in the process of creating a rather large website and so I am wanting to make it as easy for myself in the future as possible. For example, if I migrate to a new design, I don't want to have to add all the existing content again or if I add a new feature I don't want to have to add a link onto every page.

I therefore have two questions,

1) Do you see any issue in creating a template with placeholders and then loading everything else from the database. So if I add a new feature I only need to add a new link to the database instead of every (of which I may have fifty or sixty +) pages. I would also load the content, such as articles from the database so that I only need to fetch it on a new design.

2) How do large websites such as Yahoo, Facebook and Youtube solve this sort of problem. I cannot imagine they change every single page on an update, do they load things that aren't part of the design from a database?

So the overall idea is to create the HTML page, style it with a couple of CSS stylesheets and then have a PHP fetch query and put it in. So the entire site would be dynamic, but is it taking it a step too far to dynamically load even the links?

Thanks

Aside from basic HTML, server-side scripting languages provide a way to address this type of concern. For example, in ASP, you can use the #include directive so that you can build say a common header and footer, then just add the #include directive to each other page. If you need to make a change to the header, you do so in only one file.

In the case of ASP.NET (aspx), there is a concept of master pages. Using this concept, you create a master page and add content placeholders. When you create a new ASPX page (its easy if you use visual studio), you can link a master page, so that your new page, only requires you to add content to the content placeholders. ASPX even allows you to nest master pages.

Now, the idea of going beyong that and having your entire site database driven, could be something to consider if you want to provide the flexibility for a web site admin or even its users to control the look and feel of the site.

Thanks JorgeM, I'm using PHP as my Server Side.

The site is a social network, so I think it would be good for the user to have a lot of control and allow them to display/hide articles and personalise things like thier profile page.

Providing there is nothing wrong with go full db driven, I am assuming it shall have speed effects and shall increase server workload but I imagine these are only marginal?

The variations in performance are going to depend on many factors. You may pay close attention to the back-end database, but not code your front-end, javascript, etc... effiently and you'll see issues.

I would say that if you follow all best practices for the web server, client-side code, back-end database design, effecient join operations, etc..., you should be OK. Everything has a cost, you just have to balance what you are willing to pay for to gain in exchange.

Thanks again JorgeM,

I shall go for a combination of PHP includes for things like the Headers and Footers and then I shall have the articles loaded Dynamically.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.