render optional parameters of block

Vote:
 

I have two optional properties and a required property in the block

[Display(
GroupName = SystemTabNames.Content,
Order = 10)]
public virtual string Heading { get; set; }

[Required(AllowEmptyStrings = false)]
[Display(
GroupName = SystemTabNames.Content,
Order = 20)]
public virtual XhtmlString Description { get; set; }

[Display(
GroupName = SystemTabNames.Content,
Order = 30)]
public virtual Url ButtonLink { get; set; }

and in the view


@Html.PropertyFor(x => x.Heading)
@Html.PropertyFor(x => x.Description)
@Html.PropertyFor(x => x.ButtonLink)


when I tried to create a block in CMS, I could just see the required property 'Description'.
Though the other properties are not mandatory, but I want to see them when I create a block.
Question 1:I could see the optional properties after the block is being created, not sure if it's always the case.
Question 2: If I try to add some content to heading after the block is created, it's throwing an error 'the
insert statement conflicted with the foreign key constraint 'fk_tblWorkContentProperty_tblPropertyDefinition'
the conflict occured in database table tblPropertyDefinition'
Question 3: Is the code written in the view is the right way of rendering the block content?

#148700
May 20, 2016 12:10
Vote:
 

Hi Anusha,

1. Grzegorz wrote a blog post on how to show additional properties on content creation: https://gregwiechec.com/2015/11/show-additional-properties-on-content-creation/
2. Difficult to tell. Happens sometimes in shared db dev environments (where developer don't have their own DB copy). Does it help if you restart IIS?
3. Yes

#148701
May 20, 2016 13:22
* 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.