Add route values to Region MvcData and Controller Actions#29
Add route values to Region MvcData and Controller Actions#29willprice76 wants to merge 4 commits intoRWS:developfrom
Conversation
… to configure region views (for example providing #cols and displaytype to generic region view for column layout)
|
We should deal with "conflicts": multiple CTs for the same Region (name), but with different route values; the first one will "win", but we should log the fact that there are conflicts (like we do for Region view name). |
|
Understood - I will update to log conflicts - Given that the CM implementation is temporary (a workaround until there are proper regions in the CM), why not reuse the existing routeValues metadata field and pick up anything with a prefix 'region' for now? |
|
Isn't a separate metadata field just as easy, more explicit and hence clearer for a user? |
|
OK - you convinced me - I will make that update |
|
Note the change in PR #27 - this means that rather than logging conflicts in region mvc data, we can simply start rendering a new duplicate region - which is the desired behaviour if we have, for example 2 consecutive 3-Column regions, but the first having different route values than the second. |
|
Note that I have added the regionRouteValues metadata field after the regionName metadata field, and now have following Descriptions for the CT metadata fields:
|
|
TSI-1944 (internal issue ID for tracking purposes) |
Update to allow Region MvcData to also have route Values (similar to Entity MvcData). This allows for the parameterisation of Region views (see issue #28). The implementation in the DefaultModelBuilder is to get the route values from the CT metadata (routeValues), as for entities. In future this can be updated to a more normalised method when Regions are properly modelled in the CM.
Now I can create a single generic N-Column region view and specify regionCols and regionType route values on the CT metadata (and different region names like 3-Column, 2-Column etc.), which enable me to configure the view column layout logic and render different class and other HTML attributes depending on the regionType.