I'm coming to Drupal from more conventional MVC frameworks (Laravel, CakePHP, etc.)
In those frameworks, if I want a specific element (say, a form) to appear only on specific pages, then I basically do this:
- First, I register a route which maps a URL pattern (e.g.,
/path/to/form/page) to a PHP controller method (e.g.,
- Then, from
FormController::display(), I return a view which includes the HTML for that form.
Things seem to be very different in Drupal, and it's really confusing me. I think I've figured out how this works in Drupal, maybe – but it's so bizarre (compared to what I'm used to) that part of me thinks it can't possibly be right.
So: can you please confirm (or deny) the following?
In Drupal, I should add all blocks that will ever appear in a particular region (on any URL) to that region (on the Structure > Block Layout page).
I should then configure the Visibility > Pages tab of each block to control which URL(s) it should appear on.
So, for a large site, the "Content" section of my Block Layout page could potentially include dozens of blocks. And it would therefore be misleading to think of the Block Layout view as a preview version of any given page on my site. It's just a listing of which blocks might appear in a region on any given page, depending on how the block placements are configured.
Is that basically right?