开发者

How do i get the tab name in a usercontrol umbraco

开发者 https://www.devze.com 2023-01-28 13:40 出处:网络
Does anyone know how to get the tabname of a contentpage? I know how to get the id but not how to get the name?

Does anyone know how to get the tabname of a contentpage? I know how to get the id but not how to get the name? This is my code so far:

 int userId = umbraco.BasePages.UmbracoEnsuredPage.GetUserId(umbraco.BasePages.UmbracoEnsuredPage.umbracoUserContextID);  
           DocumentType typeToCreate = DocumentType.GetByAlias("FAQItem");

                Document newDoc = Document.MakeNew("test123", typeToCreate, new global::umbraco.BusinessLogic.User(userId), 1161);
                newDoc.getProperty("yourName").Value = newDoc.getProperty("Question");

                    foreach(var prop in newDoc.GenericProperties)
                    {
                        newDo开发者_StackOverflowc.getProperty("email").Value += prop.PropertyType.TabId + " ";
                    }


I managed the same using .getVirtualTabs, something like:

foreach (var t in dt.getVirtualTabs())
 {
  if (t.Id == id)
  return t.Caption;
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号