0

I need to allow users to store monthly estimates so that they can be later retrieved in our management information system.

It would look something like this but with the next 12 months. The first data row would hold the current month.

Month Estimate Programme activity comment
July 2024 10 prog1 act1 initial guess
Aug 2024 15 prog1 act1 more demand
... ... ... ... ...
June 2025 3 prog1 act1 Initial guess

The programme and activity columns are already Taxonomy items within the CMS.

We are now on Drupal 10. From what I can see (and as usual in Drupal!) there are a few approaches I could take - just a custom table and form, a custom entity, a content type and fields or even a plain MySQL table. Ideally when the user loaded the page, they would see the existing entries. So I am thinking of a view with a custom bulk operation on each entry. I am assuming I would reuse the Taxonomy items rather than create another table to store these items in.

We generally use the Webform module for forms. Talking with colleagues, we would always use the latest estimate supplied, so from a data retrieval point of view, a table that just timestamps every update would be fine and we could see a history of changes like that.

Is there a best practice way of approaching this in Drupal 10?

2
  • 1
    Not really, there are lots of smaller "best practices" that will crop up along the way, and I'm sure people will have their own opinions on what might be the right approach, but ultimately: no, there's no accepted best practice for your specific scenario. Please be aware that questions asking for opinions, which is essentially what this question is asking (deliberately or otherwise), are off topic here and likely to be closed. The help center has more info on that. Maybe you could edit it to concentrate on a more specific part of the implementation, and remove the need for answers to be opinionated
    – Clive
    Commented Jul 10 at 15:11
  • I see your point, but not sure where the best place to ask a question like this is? I wondered if there was a best practice way of handling a custom project like this, hence the question. Thanks for coming back, the answer from Patrick Kenny below also points me in the right direction.
    – ChumKui
    Commented Jul 11 at 8:44

1 Answer 1

1

a custom table and form, a custom entity, a content type and fields or even a plain MySQL table

Speaking very generally, I would first try to use a content type and fields, since custom content types can be built and customized entirely via the UI and give you all the nice extras provided by nodes, plus lots of additional options in contrib. It's also extremely easy to reuse the taxonomy terms and VBO with this approach.

You could also use Webform for this; I don't know which would be more work to configure, webform or a custom content type.

If I wanted to avoid the overhead of nodes, I would use a custom entity, but then you need to add Views support.

I would avoid using a custom table + form or plain MySQL table. If needs change and you need to rework the feature, it's much easier to have your data in Drupal stored as entities.

1
  • Thanks Patrick - I'll have a play around and see what I can come up with!
    – ChumKui
    Commented Jul 11 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.