有没有办法,我可以访问使用C#标签的一把umbraco的方法吗?我通过每一个属性在某个特定的标签,这样我可以显示/隐藏取决于该选项卡中是否有它的内容或不是网站的该部分试图循环。
Is there a way that I can access tabs in umbraco using C#? I am trying to loop through each property in a particular tab so that I can show/hide that section of the website depending on whether that tab has content in it or not.
我已经试过 ContentType.Tab.GetTab();
但是这有一个id,我无法找到一个标签ID的任何位置
I have tried ContentType.Tab.GetTab();
but that takes an id and I can't find a tab id anywhere.
感谢。
您可以使用 getVirtualTabs
方法,则该选项卡内环路的foreach属性
you can use getVirtualTabs
method then loop foreach property inside that tab
Node current = Node.GetCurrent();
DocumentType dt = DocumentType.GetByAlias(current.NodeTypeAlias);
if (dt != null) {
foreach(var tab in dt.getVirtualTabs) { //get all tabs
foreach(var propertyType in tab.PropertyTypes) { //loop through each property inside the Tab
// propertyType.Name
//....write here your code
}
}
}
上一篇:ListView的滚动速度慢而从内部存储的图像加载速度慢、图像、加载、ListView
下一篇:在附加/设置ArraySegment protobuf网memcache的供应商失败供应商、ArraySegment、protobuf、memcache