Jump to content

Question regarding web development

Go to solution Solved by colonel_mortis,

There are a few ways that you could do it, but manually creating lots of HTML files is generally not the best option.

  • Use server-side scripting (node.js, ruby, php, go, ...) to generate the pages on request, using a database or similar to store the content
  • Use client-side scripting (react, vue, angular) for the front end, then serve the content separately (eg have json files with the page content, which is then rendered on the client side)
  • Use server-side precompilation (jekyll, gatsby) to precompile static HTML files from a template and the data

The advantages of all of these approaches is that they allow you to modify the template independently from the content, so if you change the design of the page or add a nav item, you don't need to manually edit all of the actual pages.

 

If you expect the content to not change very often, and to only ever be changed by you, then server-side precompilation is probably best. On the other hand, if you want to expose an interface for non-technical users to make changes, compiling the pages might be more awkward, and either of the other options ought to work fine.

Hello, I am currently in the process of creating a website for a small enterprise. I made a nav item called "Collections" where it is then divided (when hovered upon) into various categories for the type of products that will be sold (Rings, Bracelets etc). And then Under "Rings" (when selected), multiple items that can be bought are displayed in a gallery form (image + a "<p>click here for more details<p>" just below). When you select an individual item, a new page (target="_blank") will open that will display price/description of said selected item.

Since in the future, there will probably be hundreds of items with their price/descriptions, should i make an individual html file for each? is there a way to have 1 html file and a new page opening depending on which item was selected? Or is server side scripting the most efficient way?

 

Thanks.

Link to comment
Share on other sites

Link to post
Share on other sites

There are a few ways that you could do it, but manually creating lots of HTML files is generally not the best option.

  • Use server-side scripting (node.js, ruby, php, go, ...) to generate the pages on request, using a database or similar to store the content
  • Use client-side scripting (react, vue, angular) for the front end, then serve the content separately (eg have json files with the page content, which is then rendered on the client side)
  • Use server-side precompilation (jekyll, gatsby) to precompile static HTML files from a template and the data

The advantages of all of these approaches is that they allow you to modify the template independently from the content, so if you change the design of the page or add a nav item, you don't need to manually edit all of the actual pages.

 

If you expect the content to not change very often, and to only ever be changed by you, then server-side precompilation is probably best. On the other hand, if you want to expose an interface for non-technical users to make changes, compiling the pages might be more awkward, and either of the other options ought to work fine.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×