< 242022-05-25⋎26 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
01:28mstenta[m]paul121: FYI I opened this issue www.drupal.org/project/farm/issues/32821
01:28mstenta[m]if you have any insights on this can you add them there when you have a chance?
01:31*coralgoat has left (Leaving)
09:00*AllanMacGregor[m has quit (Quit: You have been kicked for being idle)
09:00*kunigunde[m] has quit (Quit: You have been kicked for being idle)
09:00*oliverp44[m] has quit (Quit: You have been kicked for being idle)
09:06*farmBOT has quit (Ping timeout: 240 seconds)
09:06*farmBOT has joined
14:32MarcosCarballal[Hi all, I am working on re-creating this figma page (www.figma.com/proto/Qphf9J98kT8oBovPzRnE) using the Forms API. I am struggling to find a reasonable way to accomplish the "Add another Contact" button, which needs to manipulate the form to allow for another contact input.
14:32MarcosCarballal[I am using the $form_state with some custom attributes to store the state of how many contacts are currently on the screen, but I think I am doing it wrong. Happy to share my code or do a brief call if possible.
14:35mstenta[m]Marcos Carballal: you need `#ajax` :-)
14:36MarcosCarballal[Yes I am using ajax
14:36MarcosCarballal[Just incorrectly 😆
14:36mstenta[m]I'm not at my computer right now
14:36mstenta[m]There is an example in farmOS
14:36mstenta[m]In the planting quick form
14:36mstenta[m]Maybe also in the drupal examples module
14:38MarcosCarballal[api.drupal.org/api/examples/form_api_exa I was basing my solution off of this one.
14:39mstenta[m]If you can share your code somewhere I can take a look
14:41MarcosCarballal[pastebin.com/LE10swvr
14:45MarcosCarballal[Interesting bit on line 242. I had (i < $form_state->get('num_lines') but it wasn't rebuilding how I was expecting to
14:45mstenta[m]This is going to be difficult to read on my phone :-)
14:45MarcosCarballal[Haha all good. It is not urgent.
14:45mstenta[m]I might recommend deleting everything (temporarily) but the part you're working on. Get it working simply (like the example) first and build up from there
14:46mstenta[m]Maybe even just copy the example into your code, make sure that works, then iterate on it till it does what you want
14:49MarcosCarballal[I'll give that a shot.
16:36MarcosCarballal[Okay I think that I now have a more specific issue. So I did as you suggested and started with the example form. I was able to get an add/delete setup that makes the fields just fine. However, when I try and bring in some data from the database to populate the drop-down, it breaks the "Add another button" with the... (full message at libera.ems.host/_matrix/media/r0/downloa)
16:37MarcosCarballal[ * Okay I think that I now have a more specific issue. So I did as you suggested and started with the example form. I was able to get an add/delete setup that makes the fields just fine. However, when I try and bring in some data from the database to populate the drop-down, it breaks the "Add another button... (full message at libera.ems.host/_matrix/media/r0/downloa)
18:14mstenta[m]Hi Marcos Carballal - just sat down at my computer... catching up...
18:16mstenta[m]Is the pastebin still relevant? Or could you share your updated code?
18:22MarcosCarballal[I can make another paste bin
18:23MarcosCarballal[pastebin.com/nGQ37CB4
18:23mstenta[m]ahh much better on a big screen :-)
18:23MarcosCarballal[This bit of code doesn't have the same symptoms
18:24mstenta[m]The pastebin doesn't have the same symptoms you described above?
18:24MarcosCarballal[But if for example `getAwardeeContactNameOptions()` is changed to look like `getAwardeeOptions()` (grabbing dynamically form db) then those symptoms will show
18:25mstenta[m]Might be hard to understand via chat. Do you have any time to look at it together?
18:25MarcosCarballal[Yes I do
18:26mstenta[m]Hop into the Jitsi room? meet.jit.si/farmos-dev
18:26MarcosCarballal[In
18:33MarcosCarballal[meet.google.com/coh-okrp-iyn
19:00mstenta[m]Marcos Carballal: here's the link I was thinking of regarding caching: www.drupal.org/node/2598914
19:01mstenta[m]There's a lot of layers in Drupal (good for users, bad for developers), so that outlines a lot of the details and shows how to disable everything
19:01mstenta[m]Tbh I haven't really grokked it all myself in D8/9 and still lean heavily on `drush cr` 😅
19:02mstenta[m](aka the cache sledgehammer)
19:02mstenta[m]But I also haven't done a ton in the theming layer personally (I did in earlier Drupal versions for other projects, but farmOS + Gin doesn't need much from me)
19:29MarcosCarballal["When all you have is a sledgehammer, everything looks like cache" or something like that 😄.
19:29MarcosCarballal[Thanks for the resource
19:39*EvanKelley[m] has joined
19:39EvanKelley[m]Hey guys sorry to interject with another question, but currently we are working on modifying a view to have the title and the table of fields for a given asset type appear in one white area on the screen. However there are a lot of containers and divs that the view module uses by default to create the title and the table kinda getting in our way. Can anyone think of a better way in the views module that we can do something like this?
19:39*uploaded an image: (33KiB) < libera.ems.host/_matrix/media/r0/downloa >
19:39EvanKelley[m]We want it to look something like this
19:40mstenta[m]Are "Projects" assets?
19:40EvanKelley[m]Yes
19:40mstenta[m](Hi Evan Kelley :-) )
19:41mstenta[m]And what problem are you running into?
19:41mstenta[m]You want less DIVs basically? Or more control over the DIVs?
19:41mstenta[m]And CSS isn't enough?
19:43mstenta[m]It is possible to override the Twig templates that the Views module provides... but I don't know if I would recommend that... it requires some deeper understanding of the lower level structures - so while it's possible you might find it ends up taking more time understanding that than it does to just use CSS.
19:44EvanKelley[m]Hey Mike, when trying to inject our own CSS with hooks on this page we've seen there's actually a lot of div's and classes that have a 0 height but are the width of the page. The major reason I believe those exist is because the views module seprates the title of the page and the contnet of the page into two different sections and adds a lot of divs that just kinda get in the way
19:44mstenta[m]Happy to point you in that direction though if you want
19:45mstenta[m]Here are all the core Views templates that can be overridden: git.drupalcode.org/project/drupal/-/tree
19:46mstenta[m]Because you mention "page title" vs "content", you *may* actually be talking about the page template more broadly, though... not Views
19:46mstenta[m]In which case you may want the theme template (provided by the Gin theme or Drupal core itself)
19:46mstenta[m]www.drupal.org/docs/theming-drupal/twig-
19:47EvanKelley[m]Hmm okay it is labeled as a page in the Views UI when we create it there. I was trying to follow the steps that were posted in here I believe on Tuesday when Marcos was asking about it but I could have done it inccorectly
19:48mstenta[m]Cool - do you want to take a look together? Would that be helpful?
19:48EvanKelley[m]Very much yes
19:48mstenta[m]:-)
19:49mstenta[m]Dev jitsi? meet.jit.si/farmos-dev
20:16*eddieironsmith[m has joined
20:16mstenta[m]Evan Kelley: here is how to set up "template suggestions" (comments in the HTML that show which template each thing comes from): www.drupal.org/node/1922666
20:17*uploaded an image: (2613KiB) < libera.ems.host/_matrix/media/r0/downloa >
20:17mstenta[m]In your `sites/default` directory is a `default.services.yml` file. copy that to `services.yml` and that's where you'll change `parameters.twig.config.debug` to `true`
20:18mstenta[m]WOW Farmer Ed !
20:20FarmerEd[m]Definitely bailing twine and pallets at the moment, but at least I didn't use Node-Red 😆
20:21mstenta[m]Haha that is awesome!
20:23*uploaded an image: (10KiB) < libera.ems.host/_matrix/media/r0/downloa >
20:23mstenta[m]Evan Kelley: this is the option for "separate buttons" in Drupal 7 w/ the Views Bulk Operations module that I was thinking of...
20:24mstenta[m]I can't seem to find that in Drupal 9... I'm asking in Drupal Slack #support to see if anyone knows. It's possible that it wasn't actually included when they merged the Views module and VBO into Drupal core (both used to be non-core modules before D8)
20:24mstenta[m]I have to imagine there's a way to do it still... I'll let you know if I find anything
20:24EvanKelley[m]Okay great, thank you so much!
20:25mstenta[m](One idea that comes to mind: override the template for it and turn it into buttons! 😆)
20:25EvanKelley[m]Yeah we just might
20:29mstenta[m]Evan Kelley: oh you know what? It might be provided by the Views Bulk Operations module: www.drupal.org/project/views_bulk_operat
20:30mstenta[m]That module used to be the primary way of adding those actions to Views before D8. With D8 they added the native "bulk update" option when they merged Views into core. So now it sounds like VBO extends the core features to add some "extras", and "separate buttons" might be one of the features it provides
20:30mstenta[m]Sort of a vestigal contrib module that just adds the bells and whistles to core now :-)
20:30EvanKelley[m]Alrighty that portion of it was a stretch goal for now so it should be fine if we figure that out later
20:30mstenta[m]I haven't tried it - but I see mention of the "separate buttons" in that modules' issue queue, so worth a try perhaps
20:31mstenta[m]Ok cool
21:28EvanKelley[m]Hey mstenta one more question I have, it appears that we don't have the "themes" directory in our repo for farmOS should we still be able to override the Twig page without it?
21:30mstenta[m]Yes
21:31mstenta[m]The themes directory is created when you run composer install, and will be populated by the gin module
21:31mstenta[m]But you will be providing your override template in a "templates" directory in your module
21:32mstenta[m]s/module/theme/
21:32mstenta[m]Your module will basically say "hey drupal ignore gin's template and use this one"
21:33mstenta[m](you'll need to implement a hook in your *.module file to tell drupal to do that)
21:34EvanKelley[m]Okay I think that's our problem then I just need to setup that hook in our module file
21:34mstenta[m]Yea. That's the part I'm not sure about off the top of my head
21:34mstenta[m]I'm off for the evening
21:34mstenta[m]But if you join Drupal slack you can get an answer pretty quick I get
21:35EvanKelley[m]Okay no worries thanks for responding when you're out!
21:35mstenta[m]s/get/bet/
21:35mstenta[m]In the #support channel

< 242022-05-25⋏26 >