0

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

4

1 回答 1

0

您可以添加一个扩展预值的类,并让您能够显式处理异常,这里有一个很好的示例,说明使用文本文件填充预值列表。

出于您的目的,您可以使用uQuery执行类似(未经测试)的操作来构建您自己的手卷预值:

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
}
于 2012-08-21T23:12:44.233 回答