Developer forum

Forum » Templates » Output Custom Field

Output Custom Field

Morten Lund
Reply

Hi,
In the User Management I have added a Custom Field named Test and as type Text.
In my Maps module I would like to output the value of that field.

Assume I have added the values:
Name: John
Test: Testvalue

The code:

@foreach (LoopItem i in GetLoop("Locations")){
    <text>Name:</text> @i.GetValue("Name")
    <text>Test:</text> @i.GetValue("Test")
}

This outputs "Name: John Test:"
Nothing is outputted from test.

I have tried with @i.GetString("AccessUser_Test"), @i.GetString("_Test") etc., but nothing?

Isn't it possible to output values from Custom Fields in the Maps Module?


Replies

 
Viktor
Reply
This post has been marked as an answer

Hi Morten,

It is possible, try @i.GetValue("Custom.AccessUser_UserCustField1") it should work, ofc change "UserCustField1" to you field name for example @i.GetValue("Custom.AccessUser_Test").

Best regards,Viktor Letavin DynamicWEB Software A/S, Russian team

Votes for this answer: 1
 
Morten Lund
Reply

Oh yes.. "Custom" in @i.GetValue("Custom.AccessUser_Test") was the answer!

Thank you Viktor

Do you know if there are any documentation about this subject somewhere?

 
Viktor
Reply

Hi Morten,

Unfortunately i didn't find any documentation about it. It will probably made in future. I can say for now custom field renders in almost same way as the rendered outside loop at usermanagement, i.e. U can access only to value and type.

Best regards,Viktor Letavin DynamicWEB Software A/S, Russian team

 

You must be logged in to post in the forum