You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standard grid looks like this, with clear delineation for content and indication of block element.
BlockPreview could look like:
This is achievable with the response enricher:
usingUmbraco.Cms.Core.Models.PublishedContent;usingUmbraco.Cms.Core.Services;usingUmbraco.Community.BlockPreview.Interfaces;namespaceLovell.Web.Extensions.BlockPreview{publicclassBlockPreviewResponseEnricher:IBlockPreviewResponseEnricher{privatereadonlyIContentTypeService_contentTypeService;publicBlockPreviewResponseEnricher(IContentTypeServicecontentTypeService){_contentTypeService=contentTypeService;}publicTask<string>EnrichAsync(stringmarkup,HttpContexthttpContext,IPublishedContent?content,string?blockEditorAlias=null,string?contentElementAlias=null,string?contentUdi=null,string?settingsUdi=null,int?blockIndex=null){varct=_contentTypeService.Get(contentElementAlias??string.Empty);// ct.Icon can be "icon-plugin color-purple" using umb-icon translates that correctly for usstringcontentElementIcon=ct?.Icon??"icon-plugin";stringcontentElementName=ct?.Name??contentElementAlias??"Block";returnTask.FromResult(WrapMarkup(markup,contentElementName,contentElementIcon));}privatestringWrapMarkup(stringinnerHtml,string?alias,string?icon){return$@"<div style=""border-radius: var(--uui-border-radius, 20px);border: 1px solid var(--uui-color-border, #d8d7d9);""> <umb-ref-grid-block> <umb-icon slot=""icon"" name=""{icon}""></umb-icon> <span slot=""name"">{alias}</span> </umb-ref-grid-block>{innerHtml} </div>";}}}
However, this might be better handled upstream in the lit web component (and allow ufm label support) and avoid those calls to the contentTypeService.
An accompanying options toggle could leave the default as no decoration.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Standard grid looks like this, with clear delineation for content and indication of block element.

BlockPreview could look like:

This is achievable with the response enricher:
However, this might be better handled upstream in the lit web component (and allow ufm label support) and avoid those calls to the
contentTypeService.An accompanying options toggle could leave the default as no decoration.
Beta Was this translation helpful? Give feedback.
All reactions