<commit_before>DXA Container Framework
============================


The DXA Container Framework is framework that provides support for container components in SDL Web & DXA.
The container is a mixture of a region and a component. The container is basically a component that can be drag & dropped onto a page. This creates an inner XPM region where other components can be dropped.
Examples of typical containers:

* Image container with overlays
* Column layouts (e.g. 3-column layout)
* Tab
* Accordion
* Carousel

To make containers to work smoothly with Experience Manager and Update Preview the containers need to be ordinary SDL Web components.
The container items are as well ordinary components added directly on the page. What container the items belongs to determines of the order of
the page and region specified in the component template.

Example of a page with containers:

- 2 Column Layout Container
- Teaser #1.1
- Teaser #1.2
- Carousel Container
- Teaser #2.1
- Teaser #2.2

Comparing traditional regions with containers:
* Region are a course-grained area on a page, such as main area, side area, header, footer etc. They are managed by the page template/view.
* Containers are more fine-grained areas on a page which can be managed by editors such as adding new layouts on the page, add components to the layouts and move components between layouts.

The framework requires a CME extension to be fully functional in SDL Web Experience Manager. DXA generates drop zones with hints on what container they represents. As Experience Manager drops new components at end end of the page (for previously empty drop zones) something is needed to rearrange the order of the page object so it becomes a well-formed container page.

The container framework comes with the following:

* CME extension
* CMS import scripts for the example module 'FlexLayout'
* Modules for DXA.Java:
  - dxa-container-framework - The container framework for DXA.Java
  - dxa-module-flex-layout - DXA.Java module with example container implementations using vanilla DXA views
* Modules for DXA.NET:
  - SDL.DXA.Container.Framework - The container framework for DXA.Net
  - SDL.DXA.Modules.FlexLayout - DXA.NET module with example container implementations using vanilla DXA views

CMS Setup
-----------

The DXA Container Framework requires you install an extension in SDL Web. It make sure all drag & dropped components in XPM ends up in the correct place.
Either compile the C# code in the 'cms/container-gravity-extension' directory or download the pre-compiled DDL here:
[container-gravity-extension-v1.1.0.dll](https://github.com/NiclasCedermalm/dxa-container-framework/raw/master/cms/container-gravity-extension/compiled/container-gravity-extension-v1.1.0.dll)

Upload the DLL to your SDL Web server and place it somewhere local on the server.
Then add the following in your %SDLWEB_HOME%\config\Tridion.ContentManager.config in <extensions> tag:

```
<add assemblyFileName="[PATH TO DLL]\container-gravity-extension-v1.1.0.dll"/><commit_msg>Updated README for DXA1.7<commit_after>DXA Container Framework
============================


The DXA Container Framework is framework that provides support for container components in SDL Web & DXA.
The container is a mixture of a region and a component. The container is basically a component that can be drag & dropped onto a page. This creates an inner XPM region where other components can be dropped.
Examples of typical containers:

* Image container with overlays
* Column layouts (e.g. 3-column layout)
* Tab
* Accordion
* Carousel

To make containers to work smoothly with Experience Manager and Update Preview the containers need to be ordinary SDL Web components.
The container items are as well ordinary components added directly on the page. What container the items belongs to determines of the order of
the page and region specified in the component template.

Example of a page with containers:

- 2 Column Layout Container
- Teaser #1.1
- Teaser #1.2
- Carousel Container
- Teaser #2.1
- Teaser #2.2

Comparing traditional regions with containers:
* Region are a course-grained area on a page, such as main area, side area, header, footer etc. They are managed by the page template/view.
* Containers are more fine-grained areas on a page which can be managed by editors such as adding new layouts on the page, add components to the layouts and move components between layouts.

The framework requires a CME extension to be fully functional in SDL Web Experience Manager. DXA generates drop zones with hints on what container they represents. As Experience Manager drops new components at end end of the page (for previously empty drop zones) something is needed to rearrange the order of the page object so it becomes a well-formed container page.

The container framework comes with the following:

* CME extension
* CMS import scripts for the example module 'FlexLayout'
* Modules for DXA.Java:
  - dxa-container-framework - The container framework for DXA.Java
  - dxa-module-flex-layout - DXA.Java module with example container implementations using vanilla DXA views
* Modules for DXA.NET:
  - SDL.DXA.Container.Framework - The container framework for DXA.Net
  - SDL.DXA.Modules.FlexLayout - DXA.NET module with example container implementations using vanilla DXA views

Prerequisites
----------------

The framework requires DXA 1.7 which includes support for SDL Web 8 and SDL Web 8.5.

CMS Setup
-----------

The DXA Container Framework requires you install an extension in SDL Web. It make sure all drag & dropped components in XPM ends up in the correct place.
Either compile the C# code in the 'cms/container-gravity-extension' directory or download the pre-compiled DDL here:
[container-gravity-extension-v1.1.0.dll](https://github.com/NiclasCedermalm/dxa-container-framework/raw/master/cms/container-gravity-extension/compiled/container-gravity-extension-v1.1.0.dll)

Upload the DLL to your SDL Web server and place it somewhere local on the server.
Then add the following in your %SDLWEB_HOME%\config\Tridion.ContentManager.config in <extensions> tag:

```
<add assemblyFileName="[PATH TO DLL]\container-gravity-extension-v1.1.0.dll"/>
{'fraction_non_alphanumeric': 0.06829896907216494, 'fraction_numerical': 0.007248711340206186, 'mean_word_length': 4.297781569965871, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3761177', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1535, 'n_words': 819}