Sections In CMS Properties

Vote:
 

In our application, we have a ton of custom properties that we have created for our Content Authors.  Often, they are disorganized and our best attempt (if available) to organize them is to have them in their own tab if the properties are related.  Within the tabs, there is even more opportunity for organization.

I was wondering if it is possible to have section headers to outline a set of related properties in one tab and if possible are there any examples?

For example, if I had properties in the Content tab that were related to social media I would like them to appear in the cms editor like:

<h2>Social Media Properties</h2>
____________________________________________

[CultureSpecific]
[Display(
   Name = "Social Media property 1",
   GroupName = SystemTabNames.Content,
   Order = 100)]
public virtual bool SocialMediaPropertyOnegetset; }

[CultureSpecific]
[Display(
Name = "Social Media property 2",
  GroupName = SystemTabNames.Content,
  Order = 101)]
public virtual bool SocialMediaPropertyTwogetset; }

#208436
Oct 23, 2019 16:44
Vote:
 

Hi,

You can create a new block class like this-

 public class SocialMediaBlock: BlockData
    {
[CultureSpecific]
[Display(
   Name = "Social Media property 1",
   GroupName = SystemTabNames.Content,
   Order = 100)]
public virtual bool SocialMediaPropertyOne{ get; set; }

[CultureSpecific] 
[Display(
   Name = "Social Media property 2",
   GroupName = SystemTabNames.Content,
   Order = 101)]
public virtual bool SocialMediaPropertyTwo{ get; set; }
}

Then create new a new property on the actual page-

  [Display(Name = "Social Media Section", Description = "Social Media Section", Order = 55, GroupName = SystemTabNames.Content)]
        public virtual SocialMediaBlock socialMedia{ get; set; }
#208440
Edited, Oct 23, 2019 19:25
Vote:
 

Thanks Ravindra!

Is there any way to do this without making it a Block?  The settings are not intended to be used like a block, but instead just organized

#208441
Oct 23, 2019 19:31
Vote:
 

It will render like this -

Social media heading

PropertyOne

PropertyTwo

So don't worry you don't need to create a new block it will show you all the property on the page.

Please try once and let me know if you have any issue

#208442
Edited, Oct 23, 2019 19:45
Vote:
 

Ravindra,

I added this and it looks great! My one concern is that I did not want the Content Authors to see this and try to use is as a normal block.

I added AvailableInEditMode = False to the definition to hide it from the block options that show up and this seems to be a perfect fit!

Thanks for your help!

#208445
Oct 23, 2019 20:16
Vote:
 

I am glad that it helped. Always happy to help the community.

#208446
Oct 23, 2019 20:20
Vote:
 

Ravindra,

Not sure if you are attending the Ascend Conference next week, but if so maybe we can meet up!

#208447
Oct 23, 2019 20:25
Ravindra S. Rathore - Oct 24, 2019 4:21
Hi Evan,
Can't make it this time but definitely will be there next year 😊
Vote:
 

I think Ravindra's solution should be preferred, but if you only want headings in-between normal properties, you could follow my blog post:
https://www.gulla.net/episerver-help-texts-improved/

Just drop the CSS border, and use only Name (not Description) in:

[Display(Name = "My custom heading!")]
[UIHint("HelpText")]
public virtual string MyCustomHeading { get; set; }
#208455
Edited, Oct 24, 2019 11:53
Vote:
 

Great post Thomas. Seems like you did lots of finding for that. Goodone.

#208457
Oct 24, 2019 13:14
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.