Hi,
You can extend the Search function and add additional parameter, for example named ParentPage (to search within Descendants of that page) :
1) edit function ~\App_Data\Razor\Composite\Search\SimplePageSearch\SearchResults.cshtml
2) add new input parameter:
You can extend the Search function and add additional parameter, for example named ParentPage (to search within Descendants of that page) :
1) edit function ~\App_Data\Razor\Composite\Search\SimplePageSearch\SearchResults.cshtml
2) add new input parameter:
[FunctionParameter(Label = "Parent Page for Search", DefaultValue = null)]
public NullableDataReference<IPage> ParentPage { get; set; }
3) add next code after the line #95:if (ParentPage != null)
{
using (var con = new DataConnection())
{
var pagesIdsOfParentPage = con.SitemapNavigator.GetPageNodeById(ParentPage.Data.Id).GetPageIds(SitemapScope.DescendantsAndCurrent).ToList();
combinedSearchResult = pagesIdsOfParentPage.Intersect(combinedSearchResult).ToList();
}
}