Skip to content

Has a password editor for TextField #7676

Answered by vitalybrandes
HengzheLi asked this question in Q&A
Discussion options

You must be logged in to vote

TextField-Password.Edit.cshtml

@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel

@{
    var settings = Model.PartFieldDefinition.GetSettings<TextFieldSettings>();
}
<div class="form-group">
    @*<label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label>*@
    <label asp-for="Text">Password</label>

    <input asp-for="Text" class="form-control content-preview-text" type="password" />
    @if (!String.IsNullOrEmpty(settings.Hint))
    {
        <span class="hint">@settings.Hint</span>
    }
</div>

TextField-Password.Option.cshtml

@{
    string currentEditor = Model.Editor;
}
<option value="Password" selected="@(currentEditor == "Password")">@T["Password"]</o…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by HengzheLi
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