| 15:54 | skipper_is[m] | ...How do you use a taxonomy as an autofill? |
| 15:55 | mstenta[m] | are you trying to add an "autocomplete" text field to a form? |
| 15:55 | mstenta[m] | maybe something like this? |
| 15:55 | mstenta[m] | github.com/farmOS/farmOS/blob/92f854b9be |
| 15:58 | skipper_is[m] | Yea, and that seems to correlate to the taxonomy of farm_crop, but when i do the same for my own taxonomy (with some values already in it) it says it cannot find the taxonomy |
| 15:59 | skipper_is[m] | "Taxonomy field quick_medical not found." |
| 15:59 | skipper_is[m] | (Also, the autocomplete for vets, in medical logs, is that autocomplete usable in forms? Is it also from a taxonomy?) |
| 16:02 | * | < matrix.org/_matrix/media/r0/download/mat > |
| 16:14 | mstenta[m] | ah... so `taxonomy/autocomplete/field_farm_crop` essentially works by leveraging the fact that there is a field called `field_farm_crop` (for referencing terms in the vocabulary) |
| 16:15 | mstenta[m] | do you have a field set up? if so make sure you use that field's name in the autocomplete path |
| 16:16 | skipper_is[m] | I have not, I have a taxonomy with a bunch of medicines as terms |
| 16:17 | mstenta[m] | ok - so if you add a term reference field to a log type, then you can reference that field's name in the autocomplete path and it should work |
| 16:17 | mstenta[m] | the field is where you configure "this field references terms in this vocabulary" |
| 16:17 | mstenta[m] | so it makes that connection |
| 16:17 | mstenta[m] | we just went with that approach because it was already set up and met our needs... i don't know if Drupal core provides a more general term reference autocomplete path |
| 16:17 | mstenta[m] | but the cool thing is: you can also just make your own routes for autocomplete paths |
| 16:17 | mstenta[m] | if you need something more custom |
| 16:18 | skipper_is[m] | so field_farm_vets should work as an autocomplete? |
| 16:18 | skipper_is[m] | (it doesn't seem to) |
| 16:18 | mstenta[m] | github.com/farmOS/farmOS/blob/c5c15043cf |
| 16:19 | mstenta[m] | if you have a field called `field_farm_vets` which is a term reference field to the vocabulary you want... it should |
| 16:19 | skipper_is[m] | the log_medical has a field called field_farm_vets |
| 16:19 | skipper_is[m] | By default |
| 16:20 | mstenta[m] | oh, but that's not a term reference field |
| 16:20 | mstenta[m] | (`field_farm_vet` correct?) |
| 16:20 | mstenta[m] | that's just a string field |
| 16:21 | mstenta[m] | we provide an autocomplete for that as well, however :-) |
| 16:21 | mstenta[m] | it's just not a term autocomplete... |
| 16:21 | mstenta[m] | and in fact, that uses the custom module i just linked to above |
| 16:22 | mstenta[m] | the `farm_fields_autocomplete` module in farmOS 1.x provides auto-complete for all text fields on logs... by searching the database for previously entered values |
| 16:22 | mstenta[m] | maybe that's what you want? |
| 16:23 | skipper_is[m] | So can I plug field_farm_vet into that? |
| 16:23 | mstenta[m] | possibly! just need to figure out the right path to use... |
| 16:24 | mstenta[m] | `farm/fields/autocomplete/[entity type]/[bundle]/[field name]` |
| 16:24 | mstenta[m] | so try this: |
| 16:25 | mstenta[m] | `'#autocomplete_path' => 'farm/fields/autocomplete/log/farm_medical/field_farm_vet',` |
| 16:25 | skipper_is[m] | oh nice one, cheers |
| 16:28 | skipper_is[m] | An I guess likewise I can use farm/fields/autocomplete/log/farm_medical/name to get an autocomplete of medical log names? |
| 16:28 | mstenta[m] | should work! |
| 16:28 | skipper_is[m] | Or can i just do farm/fields/autocomplete/log/name? |
| 16:28 | skipper_is[m] | And get all the logs? |
| 16:29 | mstenta[m] | no - needs the bundle too |
| 16:29 | skipper_is[m] | Ah ok, some of them have a +, can I choose multiple bundles (the assets/group one is assets+group) |
| 16:29 | mstenta[m] | i don't remember if there's support for that or not in `farm_fields_autocomplete.module` |
| 16:30 | mstenta[m] | you could probably see how it works pretty easily |
| 16:30 | mstenta[m] | gotta sign off... taking over with the kids :-) |
| 16:30 | mstenta[m] | good luck! |
| 16:30 | skipper_is[m] | Diolch yn fawr! |
| 17:26 | skipper_is[m] | Is there an autocomplete for quantity labels? There is for quantity units, and in the log forms there is one for quantity, but can we hook in? |
| 17:27 | mstenta[m] | Good question |
| 17:27 | mstenta[m] | The same URL as before might work |
| 17:28 | mstenta[m] | The entity type would be field_collection |
| 17:28 | mstenta[m] | Bundle is field_farm_quantity |
| 17:28 | mstenta[m] | Field is field_farm_quantity_label |
| 17:28 | mstenta[m] | I think |
| 17:29 | skipper_is[m] | farm/fields/autocomplete/log/field_collection/field_farm_quantity/field_farm_quantity_label |
| 17:30 | skipper_is[m] | Goodness me that is a good length |
| 17:30 | mstenta[m] | Minus the log piece |
| 17:30 | mstenta[m] | Haha yes... The field collections are messy like that |
| 17:31 | mstenta[m] | FWIW it would be /farm/fields/quantity/standard/label in farmOS 2.x |
| 17:32 | skipper_is[m] | At one point I'll get farmOS2 installed and start finding the weird bugs |
| 17:33 | mstenta[m] | Hahaha |
| 17:33 | mstenta[m] | Also FWIW farmOS 2.x doesn't have a farm_fields_autocomplete module yet |
| 17:34 | mstenta[m] | @paul121 did some research into an alternative module we might be able to use |
| 17:35 | skipper_is[m] | `farm/fields/autocomplete/field_collection/field_farm_quantity/field_farm_quantity_label` is returning [] when I open the URL, suggesting it is working, but doesn't seem to return any values when I actually use it, which is a shame |
| 17:36 | skipper_is[m] | field_collection_item! |
| 17:52 | mstenta[m] | oh yesss |
| 20:05 | skipper_is[m] | If creating notes programatically, how can I get a newline in? |
| 20:06 | skipper_is[m] | I tried <br> and \n |
| 20:06 | skipper_is[m] | oh < b r > |
| 20:06 | skipper_is[m] | didn't let me type it |
| 20:30 | skipper_is[m] | "/n" instead of '/nl' |
| 20:30 | skipper_is[m] | *'/n' |