# How to programmatically define and load sections, slots and blocks for a homepage (or any other page)?

**URL:** <https://forum.shopware.com/t/how-to-programmatically-define-and-load-sections-slots-and-blocks-for-a-homepage-or-any-other-page/91337>\
**Category:** Shopware 6 (English)\
**Tags:** general, programming\
**Created:** [8. November 2021 um 09:29 UTC](https://forum.shopware.com/t/how-to-programmatically-define-and-load-sections-slots-and-blocks-for-a-homepage-or-any-other-page/91337 "2021-11-08T09:29:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![krzysztof.polcode](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/krzysztof.polcode/32/15352_2.png) [@krzysztof.polcode](https://forum.shopware.com/u/krzysztof.polcode)\
**Post date:** [8. November 2021 um 09:29 UTC](https://forum.shopware.com/t/how-to-programmatically-define-and-load-sections-slots-and-blocks-for-a-homepage-or-any-other-page/91337/1 "2021-11-08T09:29:51Z")

</div>

At the moment I have found something like this 👇

> <https://github.com/Piotr20/Shopware_plugin_trial_Geni/blob/3b5182d3031771b2561effa55119b59564f249de/src/src/custom/plugins/SwagPlatformDemoData/src/DataProvider/CmsPageProvider.php>

Is there any other way to do this?  
Is there any documentation for such a functionality?

---

<div class="post-metadata">

**Author:** ![Moorleiche](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@Moorleiche](https://forum.shopware.com/u/Moorleiche)\
**Post date:** [8. November 2021 um 16:57 UTC](https://forum.shopware.com/t/how-to-programmatically-define-and-load-sections-slots-and-blocks-for-a-homepage-or-any-other-page/91337/2 "2021-11-08T16:57:35Z")

</div>

Here is an example for an own Demo Content Plugin:

> **[GitHub - moorl/DewaBakery: Demo Content for DeliveryWare](https://github.com/moorl/DewaBakery)**
>
> Demo Content for DeliveryWare. Contribute to moorl/DewaBakery development by creating an account on GitHub.

You can run it with the AppflixFoundation Plugin  
[https://docs.app-flix.de/en/foundation/demo-installer/](https://docs.app-flix.de/en/foundation/demo-installer/)

---

<div class="post-metadata">

**Author:** ![Moorleiche](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@Moorleiche](https://forum.shopware.com/u/Moorleiche)\
**Post date:** [8. November 2021 um 17:01 UTC](https://forum.shopware.com/t/how-to-programmatically-define-and-load-sections-slots-and-blocks-for-a-homepage-or-any-other-page/91337/3 "2021-11-08T17:01:37Z")

</div>

Or take this (is more simplified) with the moori Foundation Plugin

> **[GitHub - moorl/plugin-MoorlCmsBrandSlider: Shopware 6 Plugin](https://github.com/moorl/plugin-MoorlCmsBrandSlider)**
>
> Shopware 6 Plugin. Contribute to moorl/plugin-MoorlCmsBrandSlider development by creating an account on GitHub.

[https://docs.moori.net/en/MoorlFoundation/demo-assistant/](https://docs.moori.net/en/MoorlFoundation/demo-assistant/)

---

<div class="post-metadata">

**Author:** ![krzysztof.polcode](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/krzysztof.polcode/32/15352_2.png) [@krzysztof.polcode](https://forum.shopware.com/u/krzysztof.polcode)\
**Post date:** [15. November 2021 um 09:29 UTC](https://forum.shopware.com/t/how-to-programmatically-define-and-load-sections-slots-and-blocks-for-a-homepage-or-any-other-page/91337/4 "2021-11-15T09:29:25Z")

</div>

Thank you @Moorleiche
