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
Hi,
we working in examine search in umbraco, we try to retrive childname name,pls find below code, we are using
user control in csharp
We try to get schools Searching , As we tried to get the node using e.Fields.Add(“schools”, schools). We could not get the node(school) name.
Looking for the Suggestion to overcome with this issue.
if (e.Node.ExamineNodeTypeAlias().Equals("LawyerBio"))
{
var node = uQuery.GetNode(e.NodeId);
if (node != null)
IEnumerable<Node> SchoolName = node.GetChildNodesByType("LawyerBio");
if (SchoolName.Any())
IEnumerable<Node> EductationNode = SchoolName.First().GetChildNodesByType("Education");
var School = new StringBuilder();
if (SchoolName.First().HasProperty("school"))
School.Append(SchoolName.First().GetPropertyAsString("school"));
foreach(Node test in EductationNode)
School.Append(test.GetPropertyAsString("school"));
}
e.Fields.Add("School", School.ToString());
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
childnode not able to retrive
Hi,
we working in examine search in umbraco, we try to retrive childname name,pls find below code, we are using
user control in csharp
We try to get schools Searching , As we tried to get the node using e.Fields.Add(“schools”, schools). We could not get the node(school) name.
Looking for the Suggestion to overcome with this issue.
if (e.Node.ExamineNodeTypeAlias().Equals("LawyerBio"))
{
var node = uQuery.GetNode(e.NodeId);
if (node != null)
{
IEnumerable<Node> SchoolName = node.GetChildNodesByType("LawyerBio");
if (SchoolName.Any())
{
IEnumerable<Node> EductationNode = SchoolName.First().GetChildNodesByType("Education");
var School = new StringBuilder();
if (SchoolName.First().HasProperty("school"))
{
School.Append(SchoolName.First().GetPropertyAsString("school"));
foreach(Node test in EductationNode)
{
School.Append(test.GetPropertyAsString("school"));
}
e.Fields.Add("School", School.ToString());
}
}
}
}
is working on a reply...