Should I create different pages for each article? Looking for solution for sharing inidividual article

here’s the thing. I am bulding a website for a local dog shelter. There will be the main page "Dogs". Then, inside the page will be let’s say 50 dogs. Each dog will have its own description and its own pictures. I’d like that when someone is browsing the page "Dogs" and sees one he/she likes, he/she can share it with his/her friends. So I want that the user is able to share only that particular dog, not the entire page "Dogs". I guess, in order to do that I would need a separate page for each dog. Am I right?

For example in "Dogs" page, for each dog I would put only a picture and some introduction text and then a button that redirects the viewer on the dedicated page with all the content. Is this a right method or am I saying nonsense stuff?

Disclaimer: I just started the web dev "adventure", so currently I can work only with html and css… sorry! 🙂

Add Comment
3 Answer(s)

My suggestions would be:

  1. If you have enough storage on your server (if you are going to put it up on the web) and don’t mind slowish loading times, then have a page for each article.

  2. It would be worthwhile learning JavaScript. This would allow you to have a "one page site". This would make the pages load faster but on slow internet, it might take a while to load all the javascript in.

The way you could accomplish option 2 would to hide all of the home pages content, and then load in only the parts you need, you would be able to find more information on google on how to do this.

Another note: Always call your main file (like the homepage HTML file) index.html, this way, if you upload it to the server, the server will know which file to load in first.

Answered on September 1, 2020.
Add Comment

If you don’t want to create 50 dog pages with the complete same html structure, you could use a Server-side language(like PHP) and a database.

This has some advantages for example:

  1. You don’t need to change all 50 pages if you want to add a link button or a contact Form for example.
  2. Your user don’t need necessarily Javascript.

You just setup a PHP-file like dog.php, using then a variable out of a GET-Parameter as Id, to find the specific dog in the database and then load your data and give out the informations.

Answered on September 1, 2020.
Add Comment

I suggest you to learn javascript. You are going to need it before php and it would be a good learning exercise with javascript when you try to do this with javascript.

Answered on September 1, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.