How do I add custom fields

I have gone here Adding fields and many other places looking into how to add these fields to the :
Reg#
S/Tw/Trp:
Eyelids:
Horns:
Lamb Wool Color:
Adult Wool Color:
Base Color:
Pattern 1
Pattern 2
Spotting:
Extension:

to the “Add Animal” I think I have reached my knowledge of coding here, I was working on my own FarmOS-like PHP system, and then I found this, however, I have never used Drupal. it would be nice if the fields above would show up here and not in notes, having to copy and past the Reg#, Eyelides, and so on for every sheep is getting old, i need it in the format shown:

At the moment I am wasting my time looking for directory structures and looking up terminology. a little help would be nice, I am sure I am missing something. my install is in “Dockge” The terminal is located there, I will most likely add SSH later if this gets complicated. there must be or should be a way to add fields in the UI, but i am fine with the terminal if i can just figure out what is what. thanks

1 Like

Hi @brdavidosb - welcome to the forum! Looks like you’re on the right track. You found the Adding fields documentation, which describes how to add fields to a module in PHP code. This is part of the broader farmOS module development documentation, which also provides some basic info on creating your first module (where you will put the new field code). I would suggest starting there if you haven’t read it already.

Alternatively, there’s a way to add fields directly in the UI by enabling the Field UI module (via the Drupal /admin/modules page), and going to /admin/structure/asset-type. Then you can “Manage fields” on each type of asset (you can also use this for logs).

There are advantages and disadvantages to both approaches. Adding fields through the UI is convenient, and is a great way to experiment. We recommend taking the module-based approach described in the documentation because it constrains/standardizes the options a bit for consistency within farmOS, and it is better practice to maintain customizations in modules so that you can test them against future versions of farmOS, distribute them to other farmOS users, etc. The UI approach is a feature that Drupal provides, not farmOS.

Hope that helps!

1 Like

Thanks, it is slow going, but i am finely getting somewhere, God’s blessing