Using 2sxc Blogg App and when using search I get the results of the blog home page listed, which simply list the blog home and the article titles which all take the user to the blog home page, so they are pretty much useless links, then I get the actual articles with the links to the articles. So I need to suppress the blog page itself, but not its dynamic children (the articles).
/help <-- no, thanks, your links are useless.
/help/post <-- yes, please, list all.
Any idea on how I could achieve that? I got directed to CustomizeData() doc, but I have no idea what to do. The current one set on the main blog list page is as follows:
@functions{
/// <summary>
/// Populate the search - ensure that each entity has an own url/page
/// </summary>
/// <param name="searchInfos"></param>
/// <param name="moduleInfo"></param>
/// <param name="startDate"></param>
public override void CustomizeSearch(Dictionary<string, List<ToSic.SexyContent.Search.ISearchInfo>> searchInfos, DotNetNuke.Entities.Modules.ModuleInfo moduleInfo, DateTime startDate)
{
foreach (var si in searchInfos["SearchIndex"])
{
si.QueryString = "post=" + AsDynamic(si.Entity).UrlKey;
}
}
}
welcome to StackOverflow ;)
The basic DNN index asks each module for the data it has, and then builds the index on that. Since a module can have multiple items for the search, they are each an own "document" which can be configured - for example what URL to use in the search results. To enable view-developers to customize these things, 2sxc has this hook to customize the search results. So the way it's meant to work is...
So what the code should do is take each item as it was prepared by the backend, change the url to use and then let the rest of the system do its magic. If this isn't working, there are a few possibilities:
Let's try to find out what the cause is
Post your results, so we can check how this can be fixed ;)