# Plugin path - As config or custom folder setup?

**URL:** <https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715>\
**Category:** Questions\
**Tags:** v2\
**Created:** [February 14, 2018, 7:03am UTC](https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715 "2018-02-14T07:03:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [February 14, 2018, 7:03am UTC](https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715/1 "2018-02-14T07:03:34Z")

</div>

Sometimes a plugin need a configurable path like `\site\greatness\`.

There are at least two different ways to add a plugin path to a plugin.

1. As `site.php` custom folder setup: [https://getkirby.com/docs/developer-guide/configuration/folders](https://getkirby.com/docs/developer-guide/configuration/folders)
2. As `config.php` config: [https://getkirby.com/docs/developer-guide/configuration/options](https://getkirby.com/docs/developer-guide/configuration/options)

## Which do you prefer?

_Poll ([view on site](https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715/1))_

If you want you can also add a comment on your thoughts.

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [February 14, 2018, 8:46am UTC](https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715/2 "2018-02-14T08:46:10Z")

</div>

I’m not sure if I understand your question ?  
Is this about adding _any kind of_ config variables to a plugin? Or _only_ about a custom-path-variable-for-a-plugin?

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [February 14, 2018, 9:03am UTC](https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715/3 "2018-02-14T09:03:51Z")

</div>

Only paths. I looked at [https://github.com/getkirby-plugins/patterns-plugin#options](https://github.com/getkirby-plugins/patterns-plugin#options) and there `directory` is added as a config value.

I think I already have made up my mind and will keep everything in the `config.php`. It’s not that the votes flooded in this time. 😉

Best practise maybe is to only use `site.php` for Kirby core folders, not for plugins.

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [February 14, 2018, 10:28am UTC](https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715/4 "2018-02-14T10:28:07Z")

</div>

Indeed.

As I see it, `c` (as in `c::set()`) is a DI container which collects all Kirby settings. (As is `l` for localized strings).

For smaller plugins, you could use a convention that prefixes the setting with the plugin name so they are “namespaced” (as in your patterns plugin example above).

If you should have a really big plugin with loads of config options, you could roll your own DI container and bundle it with your plugin?

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:30pm UTC](https://forum.getkirby.com/t/plugin-path-as-config-or-custom-folder-setup/9715/5 "2025-02-06T17:30:04Z")

</div>


