Skip to content

"TextField": how to override "TextField.Edit.cshtml" to use my "Custom Settings" in it? #15644

Answered by MarGraz
MarGraz asked this question in Q&A
Discussion options

You must be logged in to vote

I found a solution 🥳

  1. It's not necessary to place the view in the Views/OrchardCore.ContentFields/TextField.Edit.cshtml path to override it. It's sufficient to put the TextField.Edit.cshtml in the Views folder of my module;
  2. It is mandatory in my module to add a reference in the Manifest.cs to the OrchardCore.ContentFields module, which contains TextField.Edit.cshtml (the page that we want to override): Dependencies = new[] { "OrchardCore.ContentFields" }.

🤔 I have one more question:

  • Instead of copying and pasting the original code of the TextField.Edit.cshtml view in the else part as I have done in the second example here, can I render the original TextField.Edit.cshtml using RenderPart…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Piedone
Comment options

Answer selected by MarGraz
Comment options

You must be logged in to vote
7 replies
@MarGraz
Comment options

@Piedone
Comment options

@MarGraz
Comment options

@Piedone
Comment options

@MarGraz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants