area17 / twill

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
https://twillcms.com
Apache License 2.0
3.72k stars 568 forks source link

[3.x] Locale Settings and Media Settings #2074

Closed Phiosss closed 1 year ago

Phiosss commented 1 year ago

Description

Screen Capture: image

Button for change locale is missing, Cannot save media fields

Steps to reproduce

AppServiceProvider boot method:

TwillAppSettings::registerSettingsGroup(
            SettingsGroup::make()
                ->name('site-settings')
                ->label('Site settings')
        );

Create copyright.blade.php under resources->views->settings->site-settings: image

@twillBlockTitle('Copyright')
@twillBlockIcon('text')
@twillBlockGroup('app')

<x-twill::medias 
    name="site_logo" 
    label="Site Logo"
/>
<x-twill::input 
    name="testing"
    label="Test"
    :required="true"
    :translated="true"
/>
<x-twill::wysiwyg name="left_text" label="Text in the left side" placeholder="Text" :translated="true" />
<x-twill::wysiwyg name="right_text" label="Text in the right side" placeholder="Text" :translated="true" />
<x-twill::input name="year" label="The year to use" placeholder="Text" />

Expected result

Translated fields similar to normal module translated fields. Meida will be saved.

Actual result

Language Changing button is missing and Media cannot be saved.

Versions

Twill: 3.x-dev 7badd01

Laravel: v.9.40.1

php: 8.1.0

Database: MySQL

haringsrob commented 1 year ago

hey @Phiosss this bug has been fixed in https://github.com/area17/twill/pull/2092

Screenshot 2023-01-24 at 13 03 58
Phiosss commented 1 year ago

Hi @haringsrob Thanks for fixing the translatable settings issues. But the media fields still cannot be saved. Here is more info fyr config->twill.php

'block_editor' => [
        'crops' => [
            'site_logo' => [
                'default' => [
                    [
                        'name' => 'default',
                        'ratio' => 16 / 9,
                    ],
                ],
                'mobile' => [
                    [
                        'name' => 'mobile',
                        'ratio' => 1,
                    ],
                ],
                'flexible' => [
                    [
                        'name' => 'free',
                        'ratio' => 0,
                    ],
                    [
                        'name' => 'landscape',
                        'ratio' => 16 / 9,
                    ],
                    [
                        'name' => 'portrait',
                        'ratio' => 3 / 5,
                    ],
                ],
            ],
        ],
    ],

The mediables table have the record for the setting block. But the site logo fields is empty image image image

devon2018 commented 5 months ago

@Phiosss did you ever figure this out, i'm trying to store media in settings as well, field loads fine but nothing saves.

Phiosss commented 5 months ago

@devon2018 I added :translated="true" to the media field