Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is it possible to show the property label for the Grid?
I know that typically the Grid is intended to be full-width, but it looks a bit odd in a scenario that I'm currently working on.
Any advice on how it might be possible to display the property's name & description?
Even if it's considered hacky C# code ;-)
Thanks, - Lee
Don't know how hacky you feel this is but it works.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Umbraco.Core; using Umbraco.Web.Editors; using Umbraco.Web.Models.ContentEditing; namespace UmbracoTest735.Classes { public class ContentModelModifier : ApplicationEventHandler { protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { EditorModelEventManager.SendingContentModel += (sender, e) => { IEnumerable<ContentPropertyDisplay> gridDisplayProperties = e.Model.Properties.Where(x=>x.Editor == "Umbraco.Grid"); foreach(ContentPropertyDisplay gridDisplayProperty in gridDisplayProperties) { gridDisplayProperty.HideLabel = false; } }; } } }
ooooh, I did not know about EditorModelEventManager events. I shall give that a try.
EditorModelEventManager
Thank you Ian! (I'm cool with this type of hackiness!)
Cheers, - Lee
Thanks Ian, this worked a treat! #h5yr
Yes I think its an event which has all sorts of uses. Glad it helped
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Show Label on Grid property
Is it possible to show the property label for the Grid?
I know that typically the Grid is intended to be full-width, but it looks a bit odd in a scenario that I'm currently working on.
Any advice on how it might be possible to display the property's name & description?
Thanks,
- Lee
Don't know how hacky you feel this is but it works.
ooooh, I did not know about
EditorModelEventManager
events. I shall give that a try.Thank you Ian! (I'm cool with this type of hackiness!)
Cheers,
- Lee
Thanks Ian, this worked a treat! #h5yr
Cheers,
- Lee
Yes I think its an event which has all sorts of uses. Glad it helped
is working on a reply...