I have a feature that activates as soon as a site using my custom web template is created. In that feature, I'm checking if this site is residing within my source label variation hierarchy, so I'm using...

PublishingWeb pubweb = PublishingWeb.GetPublishingWeb(web);
if(pubweb.Label != null && pubweb.Label.IsSource)

But label is null for sites that I create within 'en-us'.

I'm thinking, perhaps the label only has a value if it's the actual rootweb of the label? Or do I have to publish the site and let the variation timer jobs run before I can read the "Label"-property?


Nevermind, I just found out the problem after some more testing.

I need to let Site propagation job to run before the new site is considered to be a part of the hiearchy and thus having a Label. This means I have to find out a different way to determine if newly created site is a part of the source hierarchy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.