Find page by title and grouping page's title

Posted by Community Admin on 03-Aug-2018 02:36

Find page by title and grouping page's title

All Replies

Posted by Community Admin on 10-May-2011 00:00

I have the following code, which finds a page where the page title is "ABC" and the parent's title is "XYZ". This works well, but not if the parent is a grouping page. I can't find any properties indicating the title of a grouping page. I could probably do it some way by figuring out the URL.

var page = App.WorkWith().Pages().LocatedIn(PageLocation.Frontend).Where(p => p.Title == "ABC" && p.Parent != null && p.Parent.Title == "XYZ" && p.ApprovalWorkflowState == "Published").Get().FirstOrDefault();

Thanks

Posted by Community Admin on 10-May-2011 00:00

Hello Eric,

Try using UrlName property.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 10-May-2011 00:00

I guess it didn't have anything to do with the title. It was the ApprovalWorkflowState value, which was null for the grouping page. I changed it to the following and it seems to work...

var page = App.WorkWith().Pages().LocatedIn(PageLocation.Frontend).Where(p => p.Title == "ABC" && p.Parent != null && p.Parent.Title == "XYZ" && (p.NodeType == NodeType.Group || "Published".Equals(p.ApprovalWorkflowState))).Get().FirstOrDefault();

This thread is closed