Git Product home page Git Product logo

Comments (5)

sroutier avatar sroutier commented on May 18, 2024

Hello VickG,

I am not entirely sure what you mean by "menu node that is using a route
that takes an ID" and "Depending on the user the ID will be different".

What would this menu look like? Can you give me a use case to help picture
it?

Would you have a parent menu node called "Users Favorite Movies" and under
list a few menu entries to a movie?
Some things like this:

Menu Route
Users Favorite Movies users/{userID}/fav_movies
\ Star Trek users/{userID}/fav_movies/{movieID}
+ Star Wars users/{userID}/fav_movies/{movieID}

Is a menu like that what you have in mind?
Do you have an idea about how would you build such a variable menu in the
first place?

/s

On Wed, Jul 13, 2016 at 8:09 PM, VickG [email protected] wrote:

In my case, I want to have a menu node that is using a route that takes an
ID.

e.g.
movies/44/edit

Is there currently a way to manage this? Depending on the logged in user,
the ID will be different. Or else I would have used the "URL" field of the
menu item.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#46,
or mute the thread
https://github.com/notifications/unsubscribe/AC30Ft8tavbLBxlZ-77SMx-pOBONUSq8ks5qVX5VgaJpZM4JL-Ah
.

from laravel-enterprise-starter-kit.

VickG avatar VickG commented on May 18, 2024

Yes that is exactly what I have in mind as you mentioned.

How do I create a menu-element using your menu system that uses a route like:
users/{userID}/fav_movies

I picked the correct route from the Routes dropdown and I put this in the "URL" field
users/{id}/fav_movies
but no luck..

Any advice?

On Jul 13, 2016, at 7:47 PM, Sebastien Routier [email protected] wrote:

Hello VickG,

I am not entirely sure what you mean by "menu node that is using a route
that takes an ID" and "Depending on the user the ID will be different".

What would this menu look like? Can you give me a use case to help picture
it?

Would you have a parent menu node called "Users Favorite Movies" and under
list a few menu entries to a movie?
Some things like this:

Menu Route
Users Favorite Movies users/{userID}/fav_movies
\ Star Trek users/{userID}/fav_movies/{movieID}
+ Star Wars users/{userID}/fav_movies/{movieID}

Is a menu like that what you have in mind?
Do you have an idea about how would you build such a variable menu in the
first place?

/s

On Wed, Jul 13, 2016 at 8:09 PM, VickG [email protected] wrote:

In my case, I want to have a menu node that is using a route that takes an
ID.

e.g.
movies/44/edit

Is there currently a way to manage this? Depending on the logged in user,
the ID will be different. Or else I would have used the "URL" field of the
menu item.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#46,
or mute the thread
https://github.com/notifications/unsubscribe/AC30Ft8tavbLBxlZ-77SMx-pOBONUSq8ks5qVX5VgaJpZM4JL-Ah
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from laravel-enterprise-starter-kit.

VickG avatar VickG commented on May 18, 2024

I will take it that this is not currently supported?

from laravel-enterprise-starter-kit.

sroutier avatar sroutier commented on May 18, 2024

Sorry, busy week-end and I did not get a chance to reply to your question.
The issue is that when the URL is resolved to create the HTML menu entry, all variables ({userID} in your case) must be known to the rendering function in the MenuHandler.

I think that you have 2 options:

  1. Build a menu to your own controller with the URL/Route "users/fav_movies" that will resolve all required variables and either:
    A. Directly render the favorite movies view for the desired user or
    B. Redirect to the route that you want (i.e. "users/{userID}/fav_movies").
  2. Create your own MenuHandler that knows what variables will be needed, resolves them and replace them in the route URL before rendering the menu entry. Look at the "generateUrl()" function of the MenuHandler that you are currently using for example the "L51ESKSecuredMenuHandler" first tries to get the URL from the route if configured if that fails it gets it from the URL, right before the function returns if where I would replace any variable in the URL with resolved values.

Hope that helps a little. Let me know what you think.
/s

from laravel-enterprise-starter-kit.

VickG avatar VickG commented on May 18, 2024

ok, thank you.. I will close this.

from laravel-enterprise-starter-kit.

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.