ds_switch_view_mode allows setting the view mode used on the node level. It would be great if one could also set the view mode used on the block content (custom block) level.

Comments

dobrzyns created an issue. See original summary.

dobrzyns’s picture

Alternatively, there is the View Mode Selector, which works on block and node entities, so this might not be worth pursuing in DS.

However, I do prefer the UI approach of DS on nodes, rather than View Mode Selector's approach of having to add another field to the bundle.

DamienMcKenna’s picture

I think it'd be useful if it was made entity-generic so that it could also work with Paragraphs, ECK, etc.

travisc’s picture

Here's another example. Let's say I have a media entity reference field that I can use to chose either an image or a video and I'd like to display that media in a hero. It would be cool if I could switch the view mode based on the bundle to be displayed.

Geijutsuka’s picture

Has there been any additional analysis or work done on this functionality? Is this outside the scope of DS?

As with block entities, it would also be incredibly useful to be able to switch display modes specifically on paragraph bundles per node. For instance, there may be a paragraph bundle with a heading, description/body, and link and there are various ways to display this structure in one node/page. This would simplify the structure of data entry and paragraph maintenance immensely... It doesn't make sense to have different paragraphs or blocks with the same data construct just because the display needs to be different for essentially the same fields.

swentel’s picture

Status: Active » Closed (won't fix)

I think it's out of scope for DS, or at least in terms of maintenance for a feature that we never use anyway on our own projects.

Plus, I do like https://www.drupal.org/project/view_mode_selector to be fair :)