Hi all, I'm having trouble getting the label from the alias. It doesn't have the property for "Name". Was checking out previous solution that's should have prop.Name but i tested all the solution debugging in the solution it doesn't have the Name property
The method i have tried as:-
var home = (Home)Model.Root();
foreach (var properties in Model.Properties) { }
I don't believe you can get that from the IPublishedProperty.
I think you'll have to use the content service - note this is a database hit most likely so don't use this if you need performance. Out of interest why are you trying to get these labels on the front end?!
var contentTypeService = Services.ContentTypeService;
IContentType contentType = contentTypeService.Get("home");
var propertyTypes = contentType.PropertyTypes;
foreach (var curPropertyType in propertyTypes)
{
<p>@curPropertyType.Alias - @curPropertyType.Name</p>
<hr />
}
The reason i want it because we don't want to hardcode that section title. User can change through the label for it without having extra column field for that particular section example: Products as Label and the value is list of links. Thank for the solution will think a way that to not ping to database everytimes
Understand that just that thinking is possible using that label rather than create 1 more textfield for that title. Anyway thank for you helps on this. For now i will be creating the textfield for user to input in then for the section title.
How do i get Alias Text in the DocumentType
Hi all, I'm having trouble getting the label from the alias. It doesn't have the property for "Name". Was checking out previous solution that's should have prop.Name but i tested all the solution debugging in the solution it doesn't have the Name property
The method i have tried as:-
It doesn't consist of the Name Properties
Hi,
I don't believe you can get that from the IPublishedProperty.
I think you'll have to use the content service - note this is a database hit most likely so don't use this if you need performance. Out of interest why are you trying to get these labels on the front end?!
The reason i want it because we don't want to hardcode that section title. User can change through the label for it without having extra column field for that particular section example: Products as Label and the value is list of links. Thank for the solution will think a way that to not ping to database everytimes
It sounds like what you actually want is a separate text field and a nested content item which is a list of links.
Using the doc type name here is inappropriate and would be bad for performance.
Doctype Aliases and names are just for the backoffice.
Understand that just that thinking is possible using that label rather than create 1 more textfield for that title. Anyway thank for you helps on this. For now i will be creating the textfield for user to input in then for the section title.
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.