Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have the following code that gets all the properties of a specified tab, but I do not know how to access the values of said properties???
@{ var docType = umbraco.cms.businesslogic.web.DocumentType.GetByAlias("Homepage"); if (docType != null) { foreach (var tab in docType.getVirtualTabs) { //only get properties for 'Hero Carousel' tab if (tab.Caption == "Hero Carousel") { foreach (var propertyType in tab.PropertyTypes) { string currentPageProperty = ""; if(propertyType.Alias.Contains("carouselImage")) { currentPageProperty = "CurrentPage." + @propertyType.Alias.ToString(); } if (CurrentPage.HasValue(@propertyType.Alias.ToString()) && currentPageProperty.ToString() != null) { <a href="#" class="img">@currentPageProperty</a> } //<a href="#" class="img"><img src="@Umbraco.TypedMedia(int.Parse(@currentPageProperty)).Url" alt="@Umbraco.TypedMedia(int.Parse(@currentPageProperty)).Name"/></a> } } } } }
Hi, do you know all of the alias you need?
Are you using MVC or web forms?
You should be able to just create a new node
DynamicNode node = new DynamicNode(Node.GetCurrent().id);
if(node.hasProperty("yourpropertyalias")
{
node.getProperty("yourpropertyalias");
}
Just keep passing in your the propertys you need. Hope this helps. Charlie :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Getting property values from tab?
I have the following code that gets all the properties of a specified tab, but I do not know how to access the values of said properties???
Hi, do you know all of the alias you need?
Are you using MVC or web forms?
You should be able to just create a new node
DynamicNode node = new DynamicNode(Node.GetCurrent().id);
if(node.hasProperty("yourpropertyalias")
{
node.getProperty("yourpropertyalias");
}
Just keep passing in your the propertys you need. Hope this helps. Charlie :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.