Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Custom icon paths in config/twill.php without repeaters and blocks section #2727

Open
phyce opened this issue Feb 16, 2025 · 1 comment

Comments

@phyce
Copy link

phyce commented Feb 16, 2025

At the moment when trying to add block_editor.directories.source.icons as explained in https://twillcms.com/docs/block-editor/creating-a-block-editor.html#content-using-custom-icons is not possible without defining 'repeaters' and 'blocks'.

if we add these as empty arrays the errors stop appearing, but then content blocks disappear from the CMS. I assume this is also the case with repeaters.

Current workaround I found is by copying the default configuration for both repeaters and blocks as provided in:
https://twillcms.com/docs/block-editor/default-configuration.html

Steps to reproduce

define config/twill.php as following:

<?php

return [
    'block_editor' => [
        'directories' => [
            'source' => [
                'icons' => [
                    base_path('vendor/area17/twill/frontend/icons'),
                    resource_path('assets/admin/icons'), // or any other path of your choice
                ],
            ],
        ],
    ],
];

Expected result

Config should work without needing 'repeaters' or 'blocks'.

Actual result

We get the following error:
foreach() argument must be of type array|object, null given

Versions

Twill 3.4.1
Laravel 11.41.3
PHP 8.2.27
MariaDB 11.6

@phyce
Copy link
Author

phyce commented Feb 16, 2025

Also looks like icons don't actually show up in the CMS, even though they get listed using
php artisan twill:list:icons
and the icons can be seen when previewing in /admin/admin/icons

@phyce phyce changed the title Adding Custom paths in config/twill.php without repeaters and blocks section Adding Custom icon paths in config/twill.php without repeaters and blocks section Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant