Developer forum

Forum » Templates » Outputting item list from user

Outputting item list from user

Thomas Clausen
Reply

Hi

I'm using the Maps module to output a list of dealers, but besides the normal info like name, address, phone etc. they need to display a list of contact persons in their dealers sales team.

To solve the problem users in a specific usergroup has the ability to add their sales team thru an item list, where they can specify name, phone and e-mail.

In the backend everything works like expected, but I'm having trouble outputting the information in the frontend. I've tried with the follwing code but without success:

@RenderItemList(new {
    ItemType = "SalesPerson",
    ListSourceType = "ItemEntries",
    SourceItemEntries = location.GetInteger("UserID"),
    ItemFieldsList = "*",
    ListTemplate = "ItemPublisher/list/sales-team.cshtml"
})

Although I've added some sales persons to a users the item count is still 0.

Hope someone can tell me what I'm doing wrong or help me with an example.

Thomas Clausen - SHRPA


Replies

 
Vladimir
Reply

Hi Thomas,

There should be specified id of an item for SourceItemEntries property (or comma separated id of items)

So your code should be changed a little:

        ....
       SourceItemEntries = User.GetUserByID(location.GetInteger("UserID")).ItemId,

Best regards,

Vladimir

 

 

You must be logged in to post in the forum