https://twill.io logo
Join Discord
Powered by
# ❓questions
  • i

    ifox

    09/21/2022, 3:10 PM
    Hi @tfilos I was going to ask if it was nested
  • t

    tfilos

    09/21/2022, 3:11 PM
    That's exactly it.
  • t

    tfilos

    09/21/2022, 3:11 PM
    I partially wanted to put this here for posterity in case anyone else runs in it. Not sure why that happened
  • t

    tfilos

    09/21/2022, 3:12 PM
    I thought I needed the nested but I don't really anymore, but not sure what someone would do if they did need it
  • i

    ifox

    09/21/2022, 3:12 PM
    for reference this can happen too when the tree is "broken", as in the columns that manage the hierarchy are not correct anymore, see https://github.com/lazychaser/laravel-nestedset#checking-consistency
  • t

    tfilos

    09/21/2022, 3:13 PM
    Aha
  • t

    tfilos

    09/21/2022, 3:13 PM
    Well, glad this is all in one place for the next guy. Appreciate it
  • i

    ifox

    09/21/2022, 3:13 PM
    👍
  • s

    saeed-sikandar

    09/21/2022, 11:24 PM
    Hello mates, hope everyone is doing well basically I want to add nesting module and I successfully created now but in navigation I can't add sub menu how do created sub menu I go through docs but didn't find any resource about submenus
  • i

    ifox

    09/21/2022, 11:26 PM
    Hi @saeed-sikandar please share how you admin routes file is looking like for these modules
  • s

    saeed-sikandar

    09/21/2022, 11:27 PM
    sure 👍
  • s

    saeed-sikandar

    09/21/2022, 11:27 PM
    here is the admin route
  • i

    ifox

    09/21/2022, 11:28 PM
    This section is giving an example of using the sub navigation https://twill.io/docs/getting-started/navigation.html
  • i

    ifox

    09/21/2022, 11:28 PM
    You need to wrap your routes in groups with a prefix and then use that same structure in your navigation file
  • i

    ifox

    09/21/2022, 11:29 PM
    Oh wait I see services.articles, this is to be able to create articles directly attached to a service
  • i

    ifox

    09/21/2022, 11:30 PM
    not the same thing as the navigation organization of your modules
  • i

    ifox

    09/21/2022, 11:30 PM
    https://twill.io/docs/crud-modules/nested-modules.html#parent-child-modules
  • s

    saeed-sikandar

    09/21/2022, 11:31 PM
    yes
  • i

    ifox

    09/21/2022, 11:31 PM
    So there wouldn't be a "articles" item in the navigation for this, since it is each service that has a link to the articles belonging to that service
  • s

    saeed-sikandar

    09/21/2022, 11:33 PM
    yes, exactly
  • s

    saeed-sikandar

    09/21/2022, 11:36 PM
    so, do I need to wrap article route with services prefix ?
  • i

    ifox

    09/21/2022, 11:39 PM
    That depends on what you're trying to achieve. Are you wanting to have Services in the top navigation, and in the secondary navigation, "Services" and "Articles". Or are you trying to have articles in the secondary navigation be a link to a listing of all articles (as in not scoped by their respective service)? I'm not sure I'm following what you're trying to do.
  • i

    ifox

    09/21/2022, 11:43 PM
    I think you might have mistakingly used nested modules with the purpose of nesting the navigation, but that's probably not what you wanted. if your articles can live on their own without having to be child of services (as in, at the model level with a foreign key), then you should create articles as a normal module like services (so not nested with that dot notation in the route) and instead use a route group around the articles module route
  • i

    ifox

    09/21/2022, 11:43 PM
    that might all be a bit confusing if you recently started using Twill, let me know if you need more clarification
  • s

    saeed-sikandar

    09/21/2022, 11:44 PM
    basically I want one primary menu Services and all services title with their articles belonging to the specific services/cleaning/articles/ etc
  • i

    ifox

    09/21/2022, 11:44 PM
    ha so you definitely want services.articles for that
  • i

    ifox

    09/21/2022, 11:45 PM
    so right now when you go to services in your primary nav you are able to create articles for each service, right?
  • s

    saeed-sikandar

    09/21/2022, 11:45 PM
    in secondary navigation ?
  • s

    saeed-sikandar

    09/21/2022, 11:45 PM
    yes
  • s

    saeed-sikandar

    09/21/2022, 11:45 PM
    yes
1...403404405...484Latest