Developer forum

Forum » CMS - Standard features » User Item Type

User Item Type

Adrian Ursu
Reply

Hi Guys,

I am trying to find out how to view the fields of an ItemType that was allocated to a user?

Also, How can I write information in the ItemType if I want to store some User data in there?

If anyone can point to a documantation it would be very helpful.

Thanks,

Adrian


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

It is not in the manual yet, so only a bit under release notes.

On a group in usermanagement, right click and edit the group. On that one you can set the default item type for (new) users in that group and item type for the group itself. On the user edit, you can set the item type on the user directly. See dumps. A user can only be one item type, so if you place a user in 2 groups with 2 different default item types, only one is added.

BR Nicolai

Capture.PNG Capture1.PNG
 
Adrian Ursu
Reply

Hi Nicolai,

I got this part.

Now I need to play withe the data in template.

Templatetags does not render anything about this.

I have managed to cteate an ItemType Assigned it to a user and then I have added some data in it.

But I don't seem to be able to connect to anything. I would have expected a Loop or an ItemID

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

From where? If you are using user management module in the frontend tags are in the templates...

 
Adrian Ursu
Reply

I am using the UserManagement

Apparently it was a caching issue. Now I can see the Item Information returned by TemplateTags

Thank you very much.

Adrian

 

 
Adrian Ursu
Reply

One more question.

When I want to add values to fields in the ItemType, how should I do that? Like with the regular User Fields or like the ItemPublisher?

I am planning on using the ItemType to store Addresses. This means that I have to store in an ItemList inside the ItemType.

In theory looks pretty complicated.

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

You create an item type for the user, say "user properties". Then you create an item type "user address" with the fields you need. Then on the User properties item type, you create a field which is a list of user adresses - when editing the user, you can add adresses to him on that.

NP

 
Adrian Ursu
Reply

Hi Nicolai,

I already did that.

My question was about the method to write values in the "user address" item from front-end

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Ah. You cannot create user items in the frontend, and the item creator does not support item lists either... So that would have to be custom.

BR Nicolai

 
Adrian Ursu
Reply

:)

That's funny.

Why was it created if I cannot publish values to it natively?

Just to give the feeling I can actually extend the User object?

I could have user Linq to SQL if I wanted just to make another hack and avoid the system.

Adrian

 
Dan Avramescu
Reply

Hello,

Is there any method in the api I can use to create a new record for an item? Let's say I have an ItemType called "Address" and I want to add a new address to it. How cand I do that from code?

Thanks,

Dan

 
Nicolai Høeg Pedersen
 
Dan Avramescu
Reply

Oh ... I didn't know the Update for the Items Repository can be used to add new items. I've looked over this page before, but I thought it was only for modifying existing items.

Thanks

 

You must be logged in to post in the forum