L
L
LNK2016-04-27 21:56:05
css
LNK, 2016-04-27 21:56:05

How is content organized on a multi-page site?

My concern is how is content organized on large sites with over 200 pages? After all, they are not always on CMS, I want to make a site without using third-party systems, because the usual code is much clearer to me than other people's cms. For example, I will make up for 50 pages that have the same header, footer, menu and a couple more blocks (like authorization, for example), but what if in the future I want to add an item to the menu or remove some block that is on all pages, do not redo it all 50 pages? What do smart people do in such cases?
And what are frameworks for and how are they used?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey, 2016-04-27
@UDAV99

You make a footer and a header and other blocks in separate files, and then you call them wherever you need.

C
Cyber_bober, 2016-04-27
@Cyber_bober

In general, the essence is as follows, you create a basic template and load content into it. If you have a repeating block, then it probably makes sense to make a separate output field for it or add a hardcode to the template? It all depends on further maintenance.
Frameworks are needed in order not to invent parts for a bicycle, but to assemble your own from ready-made ones.

I
Ivan, 2016-04-27
@LiguidCool

And here we will smoothly swim to the question of why we need a backend.

T
ThunderCat, 2016-04-27
@ThunderCat

all content is divided into small blocks, which are loaded depending on the application logic that you already define. Pure PHP uses include and require to include blocks. Normal projects use wrappers and templating functions to help work with content.

C
cijiw, 2016-06-12
@cijiw

static site generator, for example, look at how they are written (I mean look at how they are arranged inside and the logic of how they work, otherwise they might just suit you)
Hugo, Nikola, etc.
www.staticgen.com
Labat each page individually oh how not cool.
Grief will come very quickly in the face of the need to slightly correct the general part on 100 pages - you will curse yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question