Sites 9 comes with one extra default template building block: Extract Components from Regions. If you upgraded your system from previous versions, re-generate default templates by running the Tools->Create Default Building Blocks command in Template Builder.
The new Building Block examines the Page item in the package and finds all regions on the page and processes each region:
For example, suppose we have following page structure:
After executing Extract Components from Regions TBB, templating package will contain following variables:
Page contains all region names and there is a separate list of CPs for each region:
Note that Components array, as it was in previous versions of SDL Web, contains an array of Component Presentations that are placed directly on the page and does not contain CPs from regions.
Next time I'll show several examples on how to use these variables.