More in this section
Forums / General Discussions / Assigning Custom Tag to a Custom profile

Assigning Custom Tag to a Custom profile

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Darrin Robertson
    Darrin Robertson avatar
    105 posts
    18 Jul 2004
    08 Dec 2013
    Link to this post
    Can anyone help me out.

    I have a custom classification named "Disciplines" which is a flat taxon.
    I also have a custom profile type named "contractor" which has been assigned with the custom taxon Disciplines.

    In code, how do I assign one of the taxons to the profile field???

    I can get the custom profile and assign a value to the ContactNumber field just fine via the below code.
    (This is from a initial create user method thus the use of CreateProfile method)

    var profName = UserProfilesHelper.GetUserProfileTypeNames().Where(u => u.Contains("contractor")).SingleOrDefault();
     var userProfile = profileManager.CreateProfile(user, profName);
     userProfile.SetValue("ContactNumber", ContactNumberTextField.Value.ToString());

    I can get the Taxon via
    var taxon = taxManager.GetTaxa<FlatTaxon>().FirstOrDefault(s => s.Title == "Disciplines");

    But how do I assign one of the taxon's, for example "Generalist", to the Contractor custom profile?

    Any help would be appreciated.
1 posts, 0 answered