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

    KUS

    08/19/2022, 6:12 PM
    I guess 1) is most interesting, 2) is Twill standard and 3) is maybe spatie/laravel-permissions
  • k

    KUS

    08/19/2022, 6:14 PM
    for 1) you need a form with @can() structure?
  • i

    ifox

    08/19/2022, 6:16 PM
    https://twill.io/docs/guides/adding-custom-roles-and-permissions.html
  • i

    ifox

    08/19/2022, 6:17 PM
    not sure if you already saw that one @KUS
  • k

    KUS

    08/19/2022, 6:18 PM
    i read this yes
  • i

    ifox

    08/19/2022, 6:18 PM
    oh well, i see you're looking to use Twill 3 permissions
  • i

    ifox

    08/19/2022, 6:18 PM
    you can still do some of it programmatically though
  • i

    ifox

    08/19/2022, 6:18 PM
    like using @can in the form
  • k

    KUS

    08/19/2022, 6:18 PM
    lets assume I have setup the roles, the question is more how do i control the UI that the user can edit text input but not delete image
  • i

    ifox

    08/19/2022, 6:19 PM
    right, ok
  • i

    ifox

    08/19/2022, 6:19 PM
    most fields have a disabled/read-only attribute
  • i

    ifox

    08/19/2022, 6:19 PM
    that you could toggle depending on the current user
  • k

    KUS

    08/19/2022, 6:19 PM
    must be probably a glocal config or controlller extending
  • k

    KUS

    08/19/2022, 6:20 PM
    ah i see
  • k

    KUS

    08/19/2022, 6:22 PM
    one could also do translator forms and switch them based on role ?
  • i

    ifox

    08/19/2022, 6:23 PM
    yes
  • d

    dakaalim

    08/20/2022, 2:27 AM
    EDIT: nevermind, I found the solution
  • t

    Tobi Wan

    08/20/2022, 9:43 AM
    Hi, new here. I have a question about secondary navigation. I have this navigation array in twill-navigation.php *return [ 'welcome' => [ 'title' => 'Welcome', 'singleton' => true, 'primary_navigation' => [ 'projects' => [ 'title' => 'Testemonials', 'module' => true, ], ], ], ];* admin.php looks like this: *Route::singleton('welcome'); Route::module('testemonials');* When I load the admin page I get PHP error: Undefined variable $_primary_active_navigation (View: ./vendor/area17/twill/views/partials/navigation/_primary_navigation.blade.php)
  • k

    kalle

    08/20/2022, 9:55 AM
    Im not sure you can use singleton as a main routing group. I would try like this.
    Copy code
    php
    return [
        'group' => [
            'title' => 'Group',
            'route' => 'admin.group.singleton',
            'primary_navigation' => [
                 'singleton' => [
                    'title' => 'Welcome',
                    'singleton' => true
                ],
                'projects' => [
                    'title' => 'Testemonials',
                    'module' => true,
                ],
            ],
        ],
    ];
    Copy code
    php
    Route::group(['prefix' => 'group'], function () {
        Route::singleton('singleton');
        Route::module('projects');
    });
    Group
    is just an example keyword, you can use own grouping keyword
  • t

    Tobi Wan

    08/20/2022, 10:05 AM
    Awesome, thanks @kalle. That works.
  • d

    dakaalim

    08/21/2022, 3:34 AM
    If modules are capsulated
    Copy code
    Route::group(['prefix' => 'options'], function () {
        Route::group(['namespace' => '\App\Twill\Capsules\Headers\Http\Controllers'], function () {
            Route::singleton('header');
        });
    
        Route::group(['namespace' => '\App\Twill\Capsules\Footers\Http\Controllers'], function () {
            Route::singleton('footer');
        });
    });
    Copy code
    return [
        'options' => [
            'title' => 'Options',
            'route' => 'admin.options.header',
            'primary_navigation' => [
                'header' => [
                    'title' => 'Header',
                    'singleton' => true,
                ],
                'footer' => [
                    'title' => 'Footer',
                    'singleton' => true,
                ],
            ],
        ],
    ];
  • k

    KUS

    08/22/2022, 3:05 PM
    Hello, I have a question: I have setup a settings functionality in v3.0 and see the form and the translation fields correct. I can enter data and they land in the setting_translations table as expected. But: my form is always empty after reload and so. What do I miss here?
  • k

    kalle

    08/22/2022, 3:12 PM
    Hello, can we please discuss this in #989876822323908608 since that version is still in testing phase 😄
  • k

    KUS

    08/22/2022, 3:13 PM
    ok
  • v

    valhalla14

    08/23/2022, 9:00 AM
    Hi, when working with Browser fields as related items it doesn't seem to link back to the edit page of the related item. Is this true or am I missing something? Setting it up as not a related item, I can see its correctly linking to the edit page.
  • h

    Harings Rob

    08/23/2022, 9:23 AM
    HEy @valhalla14 twill 2 or 3?
  • v

    valhalla14

    08/23/2022, 10:44 AM
    Hey, its twill 2.6
  • h

    Harings Rob

    08/23/2022, 10:51 AM
    Will check in a bit
  • h

    Harings Rob

    08/23/2022, 11:04 AM
    So on the latest 2.x release this should work (just tested).
  • o

    onepiece

    08/23/2022, 1:37 PM
    Hello guys. I want to completely remove the content part and leave only SEO. Is there any way? This is form.blade.php @extends('twill::layouts.form', [ 'additionalFieldsets' => [['fieldset' => 'metadata', 'label' => 'SEO']], 'sideFieldsetLabel' => twillTrans('twill::lang.nav.settings'), ]) @section('fieldsets') @metadataFields @stop @section('sideFieldset') @endsection
1...377378379...484Latest