# Adding custom fields to Tainacan taxonomy

**URL:** https://tainacan.discourse.group/t/adding-custom-fields-to-tainacan-taxonomy/597
**Category:** Dúvidas
**Tags:** taxonomias
**Created:** [Novembro 22, 2021, 1:42pm UTC](https://tainacan.discourse.group/t/adding-custom-fields-to-tainacan-taxonomy/597 "2021-11-22T13:42:19Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![mateus.m.luna](https://yyz2.discourse-cdn.com/free1/user_avatar/tainacan.discourse.group/mateus.m.luna/32/3_2.png) [@mateus.m.luna](https://tainacan.discourse.group/u/mateus.m.luna)
#### Post date: [Novembro 22, 2021, 6:48pm UTC](https://tainacan.discourse.group/t/adding-custom-fields-to-tainacan-taxonomy/597/3 "2021-11-22T18:48:44Z")

</div>

Hey @AronAmbrosiani, I actually just remembered that we have another way, but it is a bit experimental and certainly need documentation… might be a good opportunity to test it 🙂

We have a “hidden feature”, available for developers, which are _Form Hooks_. They exist in the Collection, Item, Metadata, Filter, Taxonomy and Terms forms. You can call an action `tainacan-register-admin-hooks` to _hook_ inside one of the forms and add an extra field to this form. Unfortunately, all we can give you is some code examples by now to show you situations where we did it:

Here is the Tainacan Interface theme, adding a color picker inside the Collection form, to set a `tainacan_background_color` and a `tainacan_text_color` value in the collection:

> <https://github.com/tainacan/tainacan-theme/blob/06e823447f0d4d1663782af49ed74dd6664af20f/src/functions/class-tainacanthemecollectioncolor.php#L12>

Her is another theme, adding a `expanded_filter` variable as a “yes/no” option to the Metadata form:

> <https://github.com/tainacan/Tema-IPHAN-INRC/blob/3f953e71695b6b873f8885aea9e6aff552aee964/inc/expanded_filter_relationship.php#L4>

And that same other theme, adding a taxonomy to the Collection Form:

> <https://github.com/tainacan/Tema-IPHAN-INRC/blob/3f953e71695b6b873f8885aea9e6aff552aee964/inc/register_category_taxonomy_collection_tainacan.php#L10>

Your code should be actually simpler as you only need a text input. There are other things going on in these examples. If this doesn’t help you enough or if it really doesn’t work at all, let me know. There are two hooks in the Tainacan Taxonomy form: `['taxonomy']['begin-left']` and `['taxonomy']['end-left']'`. You may also want to check that form’s source code to get a glimpse of what is going on:

> <https://github.com/tainacan/tainacan/blob/726311ba8af5d3c5d5ef9740dc9824ce74569b28/src/views/admin/components/edition/taxonomy-edition-form.vue#L43>

---

_[View the full topic](https://tainacan.discourse.group/t/adding-custom-fields-to-tainacan-taxonomy/597)._
