Pregunta

Tengo una característica que se activa tan pronto como se crea un sitio usando mi plantilla web personalizada.En esa característica, estoy comprobando si este sitio está residiendo dentro de la jerarquía de variación de la etiqueta de la fuente, así que estoy usando ...

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

Pero la etiqueta es nula para los sitios que creo dentro de 'EN-US'.

Estoy pensando, quizás la etiqueta solo tenga un valor si es el rootweb real de la etiqueta?¿O tengo que publicar el sitio y dejar que los trabajos de temporizador de variación se ejecuten antes de poder leer la "etiqueta" -property?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
scroll top