2

I try to get the login information present in the header of my Sitecore intranet automatically within a web form (from marketer) so that the logged person has not the reenter that user information already present on page.

Someone any feedback or experience therewith?

2 Answers 2

2

You can use rules for this. Look at each field property and one of these at the bottom are rules you can assign to the field.

One of the rules is populating the default value from the user profile field.

Hopefully this is what you are after.

Sign up to request clarification or add additional context in comments.

Comments

0

I think you should create a custom field type. Here is the documentation on page 55: web forms for marketers.

Here is the sample code snippet to get user e-mail:

public class UserDataEmailField : BaseControl
{
    /// <summary>
    /// Gets the result.
    /// </summary>
    public override ControlResult Result
    {
        get
        {
            var item = Sitecore.Context.Database.GetItem(this.FieldID);
            return new ControlResult(item.Name, Sitecore.Context.User.Profile.Email, string.Empty);
        }
    }
}

You should overwrite also the Render method. I hope I helped.

1 Comment

Did it helped for you?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.