Make providing customized CEs easy

Created on 22 July 2024, 4 months ago
Updated 10 September 2024, 2 months ago

Motivation

When configuring view-modes via CE-UI, we want customized component names output by default as suggested by 📌 Consistently prefix components with drupal- Active . Still, we want a working output by default and an easy way to customize it: Copy existing component and rename it.

Proposed resolution

Adopt the [...] vue component lookup logic of nuxt page router, so [...] may be used for a fallback mechanism when implement custom elements via vue-components in nuxt.

Thus, nuxt can ship with a a node-[...].vue component which acts as defautl for all node-* components.

This is something we can work into our renderCustomElements() nuxt function in nuxt-drupal-ce by default and follows the known pattern of the nuxt page router where [...] acts as a fallback. It should take the full component name, and if no match is found, remove "-[a-z]+" suffixes until one is found. This gives the flexibility to have one component for all view modes or not.

Remaining tasks

* Make ticket in nuxt-drupal-ce and implement
* adopt best-practice output in names which works well with this logic

📌 Task
Status

Fixed

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
  • Status changed to Needs work 2 months ago
  • 🇦🇹Austria fago Vienna

    The PR got implemented and merged.

    It uses fallback components like:

    ```
    drupal-view--default.vue
    drupal-form--default.vue
    ```
    As part of the change, the frontend migrated to staying with kebap-case by default for Vue components which implemnt custom elmeents. That way there is an easy and clear 1:1 mapping between this vue components and their counterpart elements.

    However, we still need to make sure this documented well in the nuxtjs-drupal-ce README. So not closing until this is done.

  • Status changed to Fixed 2 months ago
  • 🇦🇹Austria fago Vienna

    Done now, nuxtjs-drupal-ce 2.1.0 released!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024