Ship additional vue components for Drupal CMS

Created on 23 January 2025, 3 months ago

Motivation

With Drupal CMS we have opinionated content types, like an event or blog content type, which comes with a couple of fields. For having nice default output, we need a way to render them nicely.

Proposed resolution

I see two main options:
A) Make all work automagically by making sure we have good custom-elements default output + making some magic node--default.vue component that just renders all the things being there.
B) Ship with suiting CE-output config in our recipes + ship suiting frontend components for them.

B seems much easier to do and ends up with nicer, cleaner code that is easier to customize. It requires us to create this configuration and/or vue components for every recipe though.

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria fago Vienna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @fago
  • πŸ‡¦πŸ‡ΉAustria fago Vienna

    Another idea: What about some drush command that generates a vue component for a given content type and view mode?
    I already had the idea in mind to create some UI to make it easy for people to copy and paste the starter-component, so a drush command to make the same seems to be a good first step.

    Still, the drush command does not solve the "copy things to the frontend" part. We could write some bash script and ask people to run this to take care of it, and/or maybe add a drupal recipe action to take care of that part.

    Finally, just generating vue components probably ain't enough, to make things nice we probably want to add some styles anyway. That makes me thing that for now the most straight forward option would to provide drupal-cms vue components in a simple nuxt layer which just ships those components. The nuxt layer we could just add to our demo setup, since it's a simple config that people can easily remove when not needed.

  • πŸ‡¦πŸ‡ΉAustria fago Vienna

    Discussed this with arthur_lorenz and agreed that atm the most effective, short-term solution is to start with a dedicated layer which we could ship for drupal-cms, thus following solution:

    > B) Ship with suiting CE-output config in our recipes + ship suiting frontend components for them. We could ship frontend components by providing a simple nuxt layer that does nothing more than providing those components + add this nuxt-layer in our naked and shadcn demos.

  • πŸ‡ΊπŸ‡ΈUnited States glynster

    I agree with the layer side of things. ATM I am working on a webform comp and field render. I prefer to keep all the API as json and allow the frontend to render as needed. Perhaps the first step is the Nuxt Layer for admin we were chatting about? Get feedback and testing and that would be one way I can help?

  • πŸ‡¦πŸ‡ΉAustria fago Vienna

    > ATM I am working on a webform comp and field render. I prefer to keep all the API as json and allow the frontend to render as needed.
    makes sense, but how does that tie into the admin layer? Imo the admin improvements should be its own thing, the webform thing can be as well!

    > Get feedback and testing and that would be one way I can help?
    that would be definitely helpful, yes!

  • πŸ‡¦πŸ‡ΉAustria fago Vienna

    Given there will be more layers, like https://github.com/StirStudios/stir_nuxt_base/tree/release/nuxt-ui-lupus, I think we should add support for adding nuxt-layers via some optional environment variable to gitpod-links. Then we can easily build links which auto-add the layer as needed.

    For example an optional variable FRONTEND_NUXT_LAYER=github:StirStudios/stir_nuxt_base#release/nuxt-ui-lupus could add the respective nuxt-layer to a nuxt-based frontend. I'm adding a sub-task to discuss and clarify details there.

Production build 0.71.5 2024