Guruprakash C

Guruprakash C

  • NA
  • 142
  • 27.7k

How to get parent site name from subsite using Umbraco

Jan 9 2018 2:33 AM
Suggest how to get parent site name from subsite name from another root using umbraco.
For eg.
  1. Home
    1. Overview
  2. About
Assume that from search page i need to get name of the subsite name and parent site name like below:
  1. Subsite1 - Home
  2. Overview - Home
  3. Subsite1 - Parent2
  4. Subsite2 - Parent4
What i have tried:
  1. @foreach( var container in Model.Content.Children("container")  
  2. {  
  3.  var containerName = container.HasProperty("containerTitle") &&   
  4.  container.HasValue("containerTitle")? container.GetPropertyValue  
  5.  ("containerTitle"): container.Name;  
  6. }  
please suggest your logics. Thanks in advance.