https://twill.io logo
Join DiscordCommunities
Powered by
# ❓questions
  • r

    Rayderxx

    05/19/2021, 6:40 PM
    And in your model protected $presenterAdmin = JobPresenter::class;
  • d

    Dmi3yy

    05/19/2021, 6:47 PM
    Can i use select or radio for relationship belongTo? belongToMany use becouse see sample Browser) now not need and need read more info about presenter ) see error but understand its not problem in Twill )
    Copy code
    Please set the Presenter path to your Presenter :presenterAdmin FQN
    and found info go to read and learn )
  • r

    Rayderxx

    05/19/2021, 6:48 PM
    Yes you can use radio or select
  • r

    Rayderxx

    05/19/2021, 6:50 PM
    Make sure to pass your data in the formData method in the controller
  • r

    Rayderxx

    05/19/2021, 6:51 PM
    Copy code
    protected function formData($request)
        {
            return [
                'categories' => Categories::published()->pluck('title', 'id')
            ];
        }
  • r

    Rayderxx

    05/19/2021, 6:51 PM
    something like that
  • d

    Dmi3yy

    05/19/2021, 6:52 PM
    thanks
  • b

    bwaltz6

    05/19/2021, 6:54 PM
    Is there more detailed documentation on slugs and slugAttributes? Seems like one part of the documentation that needs some more clarity. I'm adding a Pages module that I want directly off the root and not under /pages. It also would be nice to add dates and other fields to slugs sometimes
  • i

    ifox

    05/19/2021, 7:05 PM
    definitely need more docs on slugs @User
    $slugAttributes
    will generate a slug in the module's slugs table for each key. most of the time, you'd use only one key, most likely
    title
    or your other "title" field. if you use multiple keys, you need the corresponding column in your slug table. this can be used to allow the same slug to exist depending on a dependent field (usually a belongsTo relationship).
  • i

    ifox

    05/19/2021, 7:06 PM
    as far as your use case, you'd want to use
    protected $permalinkBase = '';
    in your
    PageController
  • b

    bwaltz6

    05/19/2021, 7:07 PM
    that makes sense
  • b

    bwaltz6

    05/19/2021, 7:07 PM
    ah, gotcha
  • b

    bwaltz6

    05/19/2021, 7:10 PM
    how would I construct a slug like /posts/[created_date]/[title]? so for example, /posts/2021/05/19/some-amazing-post?
  • b

    bwaltz6

    05/19/2021, 7:11 PM
    if I recall correctly, you needed to override a method in the PostsRepository
  • i

    ifox

    05/19/2021, 7:14 PM
    in the frontend, routing and how you retrieve the post is kind of up to you, we do have helpers to retrieve by slug, but specific use cases would be manually resolved yes. I think you might mean, how to get that slug structure to show up correctly in the admin form, though, right?
  • b

    bwaltz6

    05/19/2021, 7:15 PM
    yes, exactly
  • b

    bwaltz6

    05/19/2021, 7:19 PM
    protected $permalinkBase = '';
    works great. I can submit a PR for the docs, if that would help
  • i

    ifox

    05/19/2021, 7:21 PM
    definitely!
  • i

    ifox

    05/19/2021, 7:21 PM
    thanks
  • d

    Dmi3yy

    05/19/2021, 8:11 PM
    In demo site we see top menu of sections https://tppr.me/PTBb0 but not see how it's turn on
  • i

    ifox

    05/19/2021, 8:13 PM
    Copy code
    @extends('twill::layouts.form', [
        'additionalFieldsets' => [
            ['fieldset' => 'attributes', 'label' => 'Attributes'],
        ]
    ])
    
    @section('contentFields')
        @formField('...', [...])
        ...
    @stop
    
    @section('fieldsets')
        @formFieldset(['id' => 'attributes', 'title' => 'Attributes'])
            @formField('...', [...])
            ...
        @endformFieldset
    @stop
  • i

    ifox

    05/19/2021, 8:13 PM
    > The additional fieldsets array passed to the form layout will display a sticky navigation of your fieldsets on scroll.
  • i

    ifox

    05/19/2021, 8:14 PM
    https://twill.io/docs/#form-fields
  • d

    Dmi3yy

    05/19/2021, 8:19 PM
    Thanks, need one more time read docs
  • d

    Dmi3yy

    05/19/2021, 8:21 PM
    and one more question i want do 4 input in one row. have any docs what style have in admin panel ? like a bootstrap colls
  • i

    ifox

    05/19/2021, 8:22 PM
    check the helper components under https://github.com/area17/twill/blob/2.x/views/partials/form/utils/
  • i

    ifox

    05/19/2021, 8:23 PM
    especially https://github.com/area17/twill/blob/2.x/views/partials/form/utils/_columns.blade.php
  • d

    Dmi3yy

    05/19/2021, 8:23 PM
    yep already there, big thanks
  • r

    Rayderxx

    05/20/2021, 7:23 AM
    is it possible to use media formField in a "Settings sections" ?
  • d

    Dmi3yy

    05/20/2021, 7:54 AM
    Yep Medias work, but not work files
1...789...484Latest