- Issue created by @fago
- 🇦🇹Austria fago Vienna
implemented the proposed solution -> added MR and a draft change notice
- 🇸🇮Slovenia useernamee Ljubljana
I checked the code and I'm wondering whether there is no nicer way to get the plugin type than substracting the prefix from the plugin id
// Remove "custom_elements_" prefix from display type. $display_type = strpos($view->getDisplay() ->getPluginId(), 'custom_elements_') === 0 ? substr($view->getDisplay()->getPluginId(), 16) : $view->getDisplay()->getPluginId();
- 🇦🇹Austria fago Vienna
Well, this "plugin type" is not an existing concept, this is just how I called it. The plugin IDs are custom_elements_page and custom_elements_block respective. But since with custom elements for a drupal-view it's pretty clear you are using one of those, repeating the custom_elements prefix seems stupid and makes just long ugly names. That's why I'd think we better remove it.
But given that, yeah, there is no better api to do that.
- 🇸🇮Slovenia useernamee Ljubljana
I approved the PR. Should we document ce name
drupal-view-{VIEW}-{DISPLAY_TYPE}
somewhere? - 🇦🇹Austria fago Vienna
thx, merged then!
There is a change-notice which documents the change. Not sure where we would it else?
I guess we should update the documentation about views at lupus-decopled.org! Automatically closed - issue fixed for 2 weeks with no activity.