If a member is not logged in, in Umbraco Contour prevalues works not correctly

237 views Asked by At

I have upgraded Contour to 1.1.9 for the use of {member.property} in the forms on the site (umbraco 4.0.3).

Works fine when your member are logged in (shows content in the input field), but if the member is not logged in, the form input will just show a plain text "{member.property}". Why is it not just showing an empty space or no info when no one is logged in?

What I do, was just to place the {member.property} in the PreValues input field in Contour.

Hope someone can help me out here?

Kind regards, Niels Kristiansen

1

There are 1 answers

0
amelvin On

You can add a class that extends prevalues and gives you the ability to handle exceptions explicitly, there's a good example here on using a text file to populate a prevalues list.

For your purposes you could use uQuery to do something like (not tested) to build your own hand rolled prevalues:

using uComponents.core;

public override List<PreValue> GetPreValues(Field field)
{
List<PreValue> result = new List<PreValue>();
var memberId = ??
var member = uQuery.GetMember(memberId);
var name = member.GetPropertyAsString("name");

result.Add(new PreValue {id=member id, value=name});

return result
}