2

I wanted to Customize the Manager Area, specific the User. I added a new Column(PhoneNumber) in the Database and the Data of this field gets in the UserEditModel. I added an new text field in the Edit.cshtml.

<div class="col-sm-6">
    <div class="form-group">
        <label>@Localizer.General["Email address"]</label>
        <input type="email" v-model="userModel.user.email" class="form-control small" maxlength="128" required />
        <div class="invalid-feedback">
            @Localizer.General["Email address is mandatory."]
        </div>
    </div>
</div>
<div class="col-sm-6">
    <div class="form-group">
        <label>@Localizer.General["PhoneNumber"]</label>
        <input v-model="userModel.user.PhoneNumber" class="form-control maxlength="128" required />
        <div class="invalid-feedback">
            @Localizer.General["PhoneNumber is mandatory."]
        </div>
    </div>
</div>

In the Model the PhoneNumber is filled with the Data from the Database, but the Phonenumber Field doesnt get the Data from the Model. Do i need to declare the Field somewhere? Do i need to change something in the piranha.useredit.js? I hope somebody can help me.

Mattia Righetti
  • 1,265
  • 1
  • 18
  • 31

2 Answers2

1

This is the method in the project Piranha.AspNetCore.Identity that is responsible for saving the user to the database.

https://github.com/PiranhaCMS/piranha.core/blob/master/identity/Piranha.AspNetCore.Identity/Models/UserEditModel.cs#L60

Anton Menshov
  • 2,266
  • 14
  • 34
  • 55
Håkan Edling
  • 2,723
  • 1
  • 12
  • 15
0

You can use the identity module as a template/ or use NuGet-package Piranha.AspNetCore.Identity and create your own identity Implementation. Follow this link for more info on Piranha Modules https://piranhacms.org/docs/master/extensions/modules

Barcollin
  • 87
  • 11