Linking sites together

Linking sites together
0

#1

Hello, I am creating a blog with images. If the main site has intro images which lead to an individual gallery after clicking an image and each gallery is separate from another - do I have to create endless amounts of html files for each gallery? This doesn’t seem right…
Thanks a lot in advance for your help.


#3

i didn’t understand well your question, if you mean how you include the gallery in all html files you can use a navbar.
but if you mean how to make a lot of pages each one have it’s unique images that cannot be done using html and css alone you need to use javascript or python or any other web programming language to make this in a dynamic way.


#4

No. There are multiple ways of doing this without creating extra html files.

One possible way is to create each gallery as a separate div and position all the galleries in the same position. Each div would need an id attribute which would be used to identify the gallery later. By default the display property would be set to none. Then you could define a click event for the container holding the intro images and display only the div with corresponding gallery of images. To identify the correct gallery, you could add a data-gallery-id attribute. You would assign the corresponding gallery div id to an image’s data-gallery-id. There are a couple other steps such as hiding the other divs when a new gallery is displayed, but you can figure that part out.


#5

Ignore my post. I did not even think about using display. id go with what @RandellDawson mentioned.


#6

The question is not very clear to me,
but as far as I can understand is that you are asking, in a website, whether each page should have its own html ?

Well, it depends… each page should have its own HTML if each of them is unique.
however, If it is not the case, then most of the HTML should be identical for pages and only Content (& its html) that needs to be changed.

In a blog for example you will find: Homepage and Single Pages.

If you look closer you’ll find that the HTML of the Homepage is different than that of the single pages,
but the HTML of these latter will mostly be identical (Copy & Pasted Code), except the Content(& it’s html).

On top of this. In most websites, you’ll find elements that are shared by many pages like the: Navbar, sidebar, footer, logo, etc…

By using HTML (only), you just need to copy and paste the code that should be shared by the other pages.

But it’s much better to use Programming languages which will help you include the repetitive parts dynamically in your pages without doing that work manually & redundantly.


#7

Thank you so much for your replies and sorry for not being too clear :slight_smile: Luckily, @RandellDawson got my point, so I know now that I don’t need to create separate HTML’s for each post and more or less know what to do next. Thanks!


#8

When you get some code working on your project and need some help, reply back to this thread with a link to your code and we will try to guide you to a final solution.