Información adicional para algunos usuarios

I am looking to add some additional content to users that should be required for users of type X example: Sales Associate's require: Profile Picture

just breaking into Orchard, i have done some looking for something like this just no luck so far.


preguntado el 05 de mayo de 13 a las 18:05

There are user profile modules available on the gallery. -

i can add content to all users, what i am looking to do is add some additional content to specific user types. example: all users have a first/last name. customer service users will have a phone number with an extension -

Right, but I don't see how the presence of the additional data is a problem. Can't you just not use it for users that don't require it? -

Definitely could. It's just that I'm not the one going to be admin on the site. Want to give them a way of adding users of type X and then showing the extra content once type X is selected. Was trying to do this with little code but am digging into the source as this seems like its going to be the way. -

There will also be multiple user types each needing to have additional content specific to the type. After reviewing the documentation I think I have an approach that will work. Need to make a little more progress before I post anything relevant. -

1 Respuestas

Every user in Orchard is of type User - there is no distinction. So you may approach the problem twofold:

  1. Create your own content types to describe various users. By default there is one type in Orchard that describes a user - "User".

    In order to make it work you'd need to write your own version of Orchard.Users module that would take that information into account. It may be quite a bit of work though as you'd need to override any piece of functionality that's there that uses the hardcoded "User" type. Best and cleanest solution, but also the most complex.

  2. Use a single content part attached to "User" type, similar to how the profile modules (eg. Contrib.Profile) work. The distinction between different user types can be done on the driver level. You're free to return different content for a given part, based on some custom logic (eg. the stored value describing "user type"). Lot less flexibility than the first approach (all other parts attached to a user will be shared by everyone), but also lot less coding.

Respondido el 20 de junio de 20 a las 10:06

Sounds resonable, thank you will be trying this over the weekend. - trabajoabyte

im going about this the wrong way. great answer but i need to change how i think about some of this stuff. Im, getting there! - trabajoabyte

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.