crp87 - Using this guide https://twillcms.com/g...
# ❓questions
c
Using this guide https://twillcms.com/guides/page-builder-with-blade/creating-a-block.html I am creating a page builder BUT inside a package inside a capsule. Moving the block(s) to the capsule inside the package works. I register them with:
Copy code
TwillBlocks::registerPackageBlocksDirectory(
            __DIR__ . '/Twill/Capsules/Pages/resources/views/twill/blocks'
        );
But how can I server the "preview(s)" which are usually located in /resources/views/site/blocks ? twill 3. and will there be a command or how do i need to adjust my commands, to generate twill resources directly inside my package>capsule?
i mean, it makes sense to have views/twill/blocks, site/blocks and site/layouts in global project, because they are styled specific to the application needs, but i want to provie a few defaults from within the package/capsule, which can be published and adjusted afterwards
i
Hi @crp87 a twill package is like a normal Laravel package so you can register publishable views
so if you configure your capsule to use those it should work whether they are published or not
c
ok, perfect! Then I'll do it that way.
sadly, it's not working as expected.
$this->loadViewsFrom(__DIR__ . '/Twill/Capsules/Pages/resources/views', 'twill-frontend-pages-views');
This way, I can load the page.blade.php layout from package but the global resources/views/site/blocks/*.blade.php and resources/views/site/layouts/*.blade.php seems the only way those files are being loaded. not from within the package. same applies to settings views. I couldn't find a register/load method on TwillAppSettings facade to set a path to load settings groups/sections from 🙂
@ifox sorry, forgot to mention you 😄