Created on 9 February 2023, over 1 year ago
Updated 26 April 2023, about 1 year ago

I'm combining the issues for custom_elements and lupus_ce_renderer so that View support can be handled by a sub-module as it's not needed by everyone. I will close those issue shortly and link to this.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Dan.Ashdown

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

Comments & Activities

  • Issue created by @Dan.Ashdown
  • 🇬🇧United Kingdom Dan.Ashdown

    Outstanding feedback still to be addressed.

    1. https://www.drupal.org/project/custom_elements/issues/3333832#comment-14... 📌 Support Views Closed: won't fix
    2. https://www.drupal.org/project/custom_elements/issues/3333832#comment-14... 📌 Support Views Closed: won't fix
    3. https://www.drupal.org/project/lupus_ce_renderer/issues/3333827#comment-... 📌 Support Views Closed: won't fix
    4. https://www.drupal.org/project/lupus_ce_renderer/issues/3333827#comment-... 📌 Support Views Closed: won't fix
  • @danashdown opened merge request.
  • 🇸🇮Slovenia useernamee Ljubljana
  • 🇸🇮Slovenia useernamee Ljubljana
  • Status changed to Needs review about 1 year ago
  • 🇬🇧United Kingdom Dan.Ashdown
  • First commit to issue fork.
  • Status changed to Needs work about 1 year ago
  • 🇦🇹Austria fago Vienna

    finally found some time to play with this.

    unfortunately I was not really get it working for a entity rendering though. it worked fine when rendering individual fields. Somehow it ended up in an end-less loop when trying to render an entity with an custom-elements enabled view-mode. When the view mode was not custom-elements enabled, it errored out due to pre-rendering step being not called. So fixed that part by invoking the view via

    $result = $view->executeDisplay($display_id, $args);
    

    That way it works when the view-mode is not custom-elements enabled.

    Also I figured routes are needlessly cloned, so I removed that part. it's a bit weird when the default route shows a custom-elements API response, but I guess this is what has been configured and should be fine for now.

    So I guess main blocker here is getting this to work for renderring entity view-modes wtih custom elements. Are you using it that way or with per-field rendering?

  • 🇦🇹Austria fago Vienna

    ok, tested again on a fresh install. Now everything worked with and without custom-elements enableld view modes. Seems like this was some issue with my previous install.

    This all works now, except that rendered entities are still wrapped in a "element": "drupal-markup".
    So we need to improve the render-array support in custom-elements such that createFromRenderArray() can detect rendered-entities that render into custom elements better. opened 📌 Improve CustomElement::createFromRenderArray() to better handle entites that render to custom elements Active for that.

    Thus, I improved naming to be consistent.

  • 🇦🇹Austria fago Vienna

    Thus, moved on and merged it! Please test and let's open new issue for remaining issues!

  • Status changed to Fixed about 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024