# Best system for components across multiple sites

**URL:** <https://forum.getkirby.com/t/best-system-for-components-across-multiple-sites/21916>\
**Category:** Questions\
**Tags:** v3\
**Created:** [April 14, 2021, 6:39pm UTC](https://forum.getkirby.com/t/best-system-for-components-across-multiple-sites/21916 "2021-04-14T18:39:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuwts](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/kuwts/32/8190_2.png) [@kuwts](https://forum.getkirby.com/u/kuwts)\
**Post date:** [April 14, 2021, 6:39pm UTC](https://forum.getkirby.com/t/best-system-for-components-across-multiple-sites/21916/1 "2021-04-14T18:39:28Z")

</div>

Hey all,

I was wondering if anyone had any experience using their own custom theme on multiple sites and what approach you took. For example, sites with similar snippets/templates + functionality but different content, images, and branding. Something similar to how you can import components in a JS front-end framework. If possible, I would like to update the snippet/template/functionality in one place and have it update across all sites.

Ideally, I would like to avoid having to manually transfer code + files from one project to the next. I was looking at using Git submodules to do this, but the hosting server I am with (Cloudways) does not support submodules when deploying from Github.

If anyone has implemented any type of system like this, I would love to hear about it. Any and all feedback is very much appreciated. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![kirbyzone](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/kirbyzone/32/9224_2.png) [@kirbyzone](https://forum.getkirby.com/u/kirbyzone)\
**Post date:** [April 15, 2021, 12:49am UTC](https://forum.getkirby.com/t/best-system-for-components-across-multiple-sites/21916/2 "2021-04-15T00:49:18Z")

</div>

Depending on what’s included in your ‘component’, you could set it up as a **[Kirby Plugin](https://getkirby.com/docs/guide/plugins/plugin-basics)**. Your Kirby plugins can include frontend code - templates, snippets, assets, etc. - as well as backend code - controllers, models, etc. They can even include other plugins.

You can build your plugin to be installable via [composer](https://getcomposer.org), and then list it in [Packagist](https://packagist.org) - it’s free. This is by far the easiest way to include your plugin in your Kirby projects and keep it up-to-date, as you update your code, across all your sites.

In Cloudways, in order to autodeploy your site when you commit your changes to your git repository, you have to manually setup a script that responds to webhook calls from your git provider - as described [here](https://support.cloudways.com/how-to-automate-git-deployment-using-webhooks). In that script, after you’ve pulled your git changes, you’d need to call `composer init` to make composer ‘load’ your plugin fresh from Packagist with every deployment.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 15, 2021, 5:35am UTC](https://forum.getkirby.com/t/best-system-for-components-across-multiple-sites/21916/3 "2021-04-15T05:35:15Z")

</div>

There are also options for private composer packages, for example on GitLab or the options mentioned here

[https://getcomposer.org/doc/articles/handling-private-packages.md](https://getcomposer.org/doc/articles/handling-private-packages.md)

---

<div class="post-metadata">

**Author:** ![kuwts](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/kuwts/32/8190_2.png) [@kuwts](https://forum.getkirby.com/u/kuwts)\
**Post date:** [April 29, 2021, 4:16pm UTC](https://forum.getkirby.com/t/best-system-for-components-across-multiple-sites/21916/4 "2021-04-29T16:16:25Z")

</div>

Sorry, I should’ve expanded. I meant the same templates, snippets, and such being used across multiple sites, but each site would have different styles, images, and such.
