-
I am wondering that is it possible to have differend Edit.cshtml to run when creating a ContentItem from the New menu vs creating an item in a BagPart. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
The Edit.cshtml view will render a BuildEditorAsync() method which will create the form required for that ContentItem. Then, the controller associated with this view expects to receive a Shape corresponding to that. So, the best way to hide fields is to use Javascript with specific content types. Not sure 100% how this would work with a BagPart. Maybe explain more in detail what you are trying to achieve and we can maybe find alternative solutions. |
Beta Was this translation helpful? Give feedback.
-
So here to resume we have : Master: Content Type with Name (Text Field), Age (Numeric Field), Trainee (Content Picker Field). MastersFacility: Content Type that is containing a TitlePart and BagPart that allows containing Masters. This MastersFacility is creatable and probably has also an AutoroutePart so that it acts as a new page. When you create a Master you want to be able to set Name, Age and Trainee from the Content List admin UI. Let me try this and I will report what I've found later on. |
Beta Was this translation helpful? Give feedback.
-
@Psichorex same answer as in #11046 (comment) Create template @{
// Remove Field shape in case of BagPart
Model.ChildContent.ContentEditor.Parts.MasterPart.Remove("MasterPart-Trainee")
}
<div class="widget-template col-md-12 px-1">
@await DisplayAsync(Model.ChildContent)
</div> |
Beta Was this translation helpful? Give feedback.
-
My probelm was solved using IShapeTableProvider
|
Beta Was this translation helpful? Give feedback.
My probelm was solved using IShapeTableProvider
I searched for a difference between two of the same content item if one is inside a BagPart
Turned out the their Prefix is different.
Using this difference I was able to make the ContentPickerField of the BagPart contained item disappear