There is a website with several pages that globally perform different functions. ("articles", "catalog", "news", well, as usual.) Each page has one / several blocks that depend on the address (for example, on the article's page, the text depends on the address, EC), and several (latest news block, mini-catalog, shopping cart ...). Questions:

  • Who is responsible for converting the CNC to id?
  • what to do if you need to insert a specific block somewhere else, where, normally, the wrong address?
  • where to store the NC-id bundle, if you consider that the title of the news page and the article may be the same, the difference is only in / articles / CNC part or / news / CNC part

now, unfortunately, everything is stupid: every text piece has a special field in the database containing its name in the CNC. This is inconvenient, since it will have to be changed in all blocks if it is changed in one.

there was a thought to compile a dictionary, but it was confused what would be the key in this dictionary. module + CNC? but then, again, you have to write a separate crutch in order to be able to show the article in an arbitrary place.

The last option is to create a complete list of pages with all the blocks that are in them. Aidishnik - full address of the page. Plus: a site map will be compiled per second. Minus: nafig do not need a router , which now occupies a label of only 15 lines and works perfectly, system flexibility is lost.

    1 answer 1

    It seems to me that, specifically in this case, universality is evil. There is some specific algorithm for which, say, on the page with an article or with a list of articles, a block with the latest news should be displayed. The article is the main essence, and the blocks are the weight of additional content that facilitates easy access to other parts of the site. And the output of this block itself should not be associated with the URL. From the URL we get only what is the article and which one, and the presence of a block with news on the article page is a programmed behavior.