Related topics in [nodebb-plugin-widget-essentials] should be filterable by the category of their parent

  • I'm glad i discovered that displaying related topics is a feature of the widget-essentials plugin : Is there any plugin to show related or similar topics on topic page?
    However, after adding this widget in my topic footer i was really disapointed that the suggested topics weren't really that related as they didn't belong to the same category (forum) of the post in question.
    I expected the category filter of the widget to be intended just for that purpose but it doesn't work on topics pages (so what's the point ?):

    0_1517582804332_Capture d’écran 2018-02-02 aΜ€ 12.36.21.png

  • Seems like a bug, that custom category option doesn't seem to be used right now in that widget. With that said, if you place the widget on a topic page it should get the topics related to that topic.

  • @baris Well.. it's not ! 😭
    It seemed like a bug to me too.. at least, not what i expected.
    Then i noticed the mention :

    If placed on a page other than categoy will pull from all recent posts

  • Yeah that help text is just wrong, that input field has no effect. If you place that widget on a topic page it does this.

    It will get the topics that have the same tags as the current topic you are in(these could be from other categories) then it will search for topics with similar titles and then it will get topics from the same category. So if you are only displaying 10 suggested topics and there are 10 topics with the same tag, you won't see any topics from the same category. Maybe we could change the code a bit so it does display a mix of all three instead of prioritizing tags.

  • @baris Thnxx for your explanation ! I got it now : the concat thing πŸ€“
    I almost agree with the priority given to tag matching over titles matching..
    But what is clearly missing is the category filter ! πŸ™‚

  • @baris But yes.. you're right : there should be a better way to do this by matching topics on tags and titles at the same time, with some ponderation.. and with a category filter if given...

  • The problem with category filter is if you specify a category id on the widget it will only work on a single category, that's why that setting doesn't make sense. For example if you set it to cid=3 and put the widget on topic.tpl, it will only display topics from category 3 even if the topic you are looking at is in a different category. That's why we get the category id from the database by looking at the category id of the topic you are in.

    I think we can improve the code by showing a mix of the 3 options(same tag, similar title, same category) instead of prioritizing tags. So essentialy we just shuffle the results.

  • I changed the code a bit so now it searches in the same category and shuffles the results.

  • Excellent work @baris (i noticed the routine maintenance screen) πŸ˜…
    Here is how i see it :
    The category filter is useful in my mind : sometimes it's just what we want because results from other sections of the forum could be totally irrelevant.. (it really depends on how your forum is divided...)
    If a category is given, we should be able to filter on the requested category, if not, maybe topics within the same category should just be given a higher weight to sort the requested n results..
    What do you think ? πŸ™‚

  • If we look at the newly Suggested Topics on bottom of this post.. they don't really seem to be particularly relevant to our discussion πŸ™‚

  • That's correct, yet they are all from the same Plugin Requests category πŸ˜†

  • Awesome @baris : i should have a look at your changes ! πŸ‘
    I think we should be able to display more relevant topics by sorting the results with a good mixed ponderation...

Log in to reply

Suggested Topics

| |