GithubHelp home page GithubHelp logo

Comments (2)

idlesign avatar idlesign commented on July 29, 2024

Sorry for the delay.
Actually such behaviour is expected.

As a fix, I think sitetree should attempting matching this against all possible urls, not just the first one returned.

You've already mentioned that there are multiple matches, so how should we define and detect the "best" match in that case?
I'm afraid there's no universal heuristic for that. Do you have one in mind?

from django-sitetree.

dwasyl avatar dwasyl commented on July 29, 2024

@idlesign It's okay, I think it's a bit different than the intended behaviour with multiple matches.

Using the setup I posted above if a user accesses http://site.com/books/1/, sitetree would display the menu as specified based on this being equal to item("{{ obj }}", "book_view obj.pk") this menu item.

However, if a user accesses http://site.com/library/books/1/, sitetree would have no matching value for this and then the sitetree_menu command as specified wouldn't display anything. If you were to comment out the first urls.py path then accessing it via the second url would match to this.

So I don't think this is an issue where there needs to be a "best" match, but since either path meets the specified item then either should be matched with this.

At the same time, when generating a link for that menu item, sitetree just picks the first matching url which is the current and likely best solution.

from django-sitetree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.