Having extracted all component presentations into package variables with the Extract Components from Regions template building block, we can work with them in Dreamweaver page design.
I doubt Dreamweaver page templates are widely used, so I put here some samples just in case somebody will need them.
Checking if page contains any regions
If page has at least one region, package will contain the PageRegions variable:
Checking if particular region exist on the page
The "Extract Components from Regions" Template Building Block adds variable named as fully-qualified region name:
Iterating over Component presentations in the specific region
Variable with fully-qualified region name contains list of component presentations in this region:
Iterating over Component presentations in all regions on the page
Variable PageRegions contains list of fully-qualified names of all regions on the page. Outer loop iterates over this collection. As package contains separate variable named after region's fully-qualified name with all component presentations, add an inner loop that will iterate over CPs in each region (@@Value@@" contains fully-qualified region name):