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

    ifox

    06/18/2021, 3:37 PM
    yes, exactly, except for the last step, you can decide which parents are allowed, nothing prevents you from returning the full collection.
  • i

    ifox

    06/18/2021, 3:38 PM
    the CMS frontend is going to expect id and name in objects of that collection, and you can also have a children key in each which will show nested in the dropdown
  • m

    Mitchell Smith

    06/18/2021, 3:39 PM
    key is parents though?
  • i

    ifox

    06/18/2021, 3:40 PM
    yes
  • m

    Mitchell Smith

    06/18/2021, 3:49 PM
    what is the second field there (the one with placeholder "Go to page")? it doesn't seem to do anything
  • i

    ifox

    06/18/2021, 3:56 PM
    If you add
    'edit' => $this->getModuleRoute($page->id, 'edit'),
    to your objects in
    parents
    , it should link to other pages
  • m

    Mitchell Smith

    06/18/2021, 3:56 PM
    I don't quite follow you there
  • i

    ifox

    06/18/2021, 3:59 PM
    what are you currently returning in the
    parents
    key?
  • m

    Mitchell Smith

    06/18/2021, 4:00 PM
    Copy code
    php
    Page::selectRaw('id, title as name')
                ->where('id', '!=', $request->route('page'))
                ->get();
  • i

    ifox

    06/18/2021, 4:00 PM
    i see, you'd need to map that collection
  • m

    Mitchell Smith

    06/18/2021, 4:00 PM
    I get that but I'm not sure what you mean by "it should link to other pages"
  • m

    Mitchell Smith

    06/18/2021, 4:00 PM
    I'm not understanding what the end result would be
  • m

    Mitchell Smith

    06/18/2021, 4:01 PM
    also wouldn't I have to convert it to an array then?
  • i

    ifox

    06/18/2021, 4:01 PM
    Ok yeah, isn't the dropdown listing the same pages as the parent dropdown above?
  • m

    Mitchell Smith

    06/18/2021, 4:01 PM
    it is
  • m

    Mitchell Smith

    06/18/2021, 4:01 PM
    but when I interact with the dropdown it does nothing
  • i

    ifox

    06/18/2021, 4:01 PM
    right, because the returned objects are not aware of that edit url
  • i

    ifox

    06/18/2021, 4:02 PM
    sharing a snippet one sec
  • i

    ifox

    06/18/2021, 4:02 PM
    it's supposed to open the page when you click in the dropdown
  • i

    ifox

    06/18/2021, 4:04 PM
    Copy code
    'parents' => $pages->map(function ($page) { 
        return [
            'id' => $page->id, 
            'name' => $page->title,
            'edit' => $this->getModuleRoute($page->id, 'edit')
         ]; 
    }
  • i

    ifox

    06/18/2021, 4:05 PM
    honestly sorry this is so rough on the edges, it's definitely on our roadmap to improve
  • m

    Mitchell Smith

    06/18/2021, 4:11 PM
    I see, I don't need this feature anyway I was just curious what it's for
  • m

    Mitchell Smith

    06/18/2021, 4:11 PM
    my dynamic routing is working out well so far
  • m

    Mitchell Smith

    06/18/2021, 4:12 PM
    I think I'm pretty much done configuring my CMS.. not exactly 7 minutes but not bad either 😉
  • u

    user

    06/21/2021, 7:35 AM
    Hello! I've been having issue setting up the admin panel via twill, to be exact, I'm having issues with logging in to the same. Whenever I pass the right credentials, the page just refreshes, yet when I pass the wrong input I get the corresponding errors related to the wrong credentials. Any idea what's the issue at hand?
  • i

    ifox

    06/21/2021, 7:39 AM
    Hi @User, not sure. Can you share some more details? Is this a fresh laravel app? What is your environment looking like? When you say just refreshes, do you mean it goes back to the login page?
  • u

    user

    06/21/2021, 7:46 AM
    Yes, pardon me, here are the details:
    Copy code
    windows(x64)
    wamp(x64)
    laravel 8.47.0
    Yes, whenever I enter the correct credentials I get redirected back to the login page. There are no errors/log files of any kind
  • u

    user

    06/21/2021, 7:47 AM
    I did generate two domains via the wamp command pannel, one called twill-test and the other admin.twill-test and navigated both of those to the same public directory, not sure if I had to do this the other way around perhaps?
  • i

    ifox

    06/21/2021, 7:48 AM
    thanks. hmm, that's interesting. Ok thanks I was going to ask your local domain setup, that's correct if you're using the subdomain.
  • i

    ifox

    06/21/2021, 7:50 AM
    can you try with:
    Copy code
    ADMIN_APP_URL=twill-test
    ADMIN_APP_PATH=admin
    and see if you're able to login at twill-test/admin
1...293031...484Latest