Twill CMS

TC

Twill CMS

Join the community to ask questions about Twill CMS and get answers from other members.

Join

Custom form fields

I'm trying to make a custom form field to override the custom WYSIWYG form field. I've followed this guide https://twillcms.com/guides/creating_custom_components_form_fields_and_blocks.html I feel like there are some steps left out of there. For example where do i need to define the Vue component? Is there a config file for that. I've been snooping around in twill source and i see everything is stored in A17Config but how could i override this or solve this. Maybe there is another way to add custom css to a WYSIWYG form field or alter tiptap config?...

New Settings approach

Hey, a i have a small question - how build a settings page like in https://demo.twill.io/settings/seo using a new appproach ? I mean, how add a multiple blocks with custom name on grey bar ?...
No description

Render repeater in block blade file

I have made a block named "gallery" with a repeater containing medias named "gallery-item", please help me to display the images in the blade file of the block. (I tried with regular block with {{ $block->image(...) }} but don't know how to do with blocks with repeaters). I tried this example but it doesn't work: https://twillcms.com/docs/block-editor/creating-a-block-editor.html#content-rendering-helpers Thank you very much....

Fetch all images in a block

How do you fetch all the images in a block? For e.g i have this block <x-twill::medias name="slide" label="Slide Show Image" max=10 />...

Repeater without blocks

How do you add and render a repeater without including it in the block?

Adding custom blocks to modules

How do you add custom blocks to modules? Generally i add blocks to a module using $form->add(BlockEditor::make()) within the controller getForm Method. However if i have created a custom block class named EditorBlade and i try to add it like $form->add(EditorBlade::make()) it gives me an error of call to undefined method Editor::make().

$renderData returns null when trying to render nestedblocks

@php /** @var \A17\Twill\Services\Blocks\RenderData $renderData */ dd($renderData) @endphp...

Fetch all models with field value of X

Sorry to ask such a basic question but I want to do the following.... I have a model called Work (and a WorkController and WorkRepository). On my Work module there is a field called "available" of type checkbox. Now i want to fetch all models with "available" selected. 1. What is best practice to implement a e.g. getAllAvailable() method? Is that on the WorkRepository, WorkController of Work model class? 2. How do I select all the models with that checkbox selected. In the laravel docs I saw this $flights = Flight::where('destination', 'Paris')->get(); but I can't seem to use the where function on my model. E.g. Work::where is not working. ...

Displaying Block elements on the Front Page

how do you display block elements on the frontpage? And i don't mean the preview file. I want to access the block elements like $item->block like that.

dashboard route

Hello. I have a problem with dashboard config I have a Category and CategoryArticle Models I have a dashboard config in twill.php ``` 'dashboard' => [...

Twill Role based access

How would i go about adding a Role based access to CMS Components and its entries. For e.g in an image module i would want to be able to allow or deny access (on the front end) to certain roles.

Twill assets error

Hello to everyone i have an website in production builded in twill but some twill assets in there are missing there, in local environment everything works fine but in there cause me those errors like in picture above anyone can help me to find a solution about this ?
No description

Where to find block repositories?

I've seen in the tutorial(https://www.youtube.com/watch?v=kAcJ5G2GhiA) some blocks like "paragraph & image" and "past project spotlight", besides in the official demo(https://demo.twill.io/work/works/2335/edit) like "fixed image grid" and "flexible image grid". Are those blocks coded somewhere? Moreover, I would like to know where I can find more community blocks. #📦packages #👊support...
No description

[3.0.0] Block class - getBlockTitle()

Hi, I was trying to move Blade blocks to Class. When I wanted to move @twillBlockTitleField in class, I thought I had to do my own logic in the getBlockTitle() method of my class which is supposed to have the block as argument. But the block is always null, indeed, the only call is in Services\Blocks\Block::parsePropertyFallback() but without arguments 😁 ...

[3.0.0] componentBlock overriding getBlockIcon doesn't seem to work?

(Successfully changed the title by overriding it's static function) Checked twill:list:icon for the wysiwyg_header icon and added the following to App\View\Components\Twill\Blocks\Article\Header.php ` public static function getBlockIcon(): string...

[3.0.0] Maintaining automated Permalink Generation when using getCreateForm to add fields.

As soon as I add any fields, using the Formbuilder on this function, the automated permalink disappears. is there a simple way of maintaining the permalink functionality, even by attaching it to a suitably named text field? I think the workaround for me right now, is just run with just the title, and make the other fields required in the main (editing) form....

multi select selected options

I'm using the multi select as documented in https://twill.io/docs/form-fields/multi-select.html#multi-select, but I can't find a way to mark options as selected by default.

[3.0.0-rc4] - How to show current value in a select form field

Currently I have my select field defined as: `@formField('select', [ 'name' => 'work_year', 'label' => 'Year',...

[3.0.0-rc4] Images not found on remote server - League\\Glide\\Filesystem\\FileNotFoundException

I just went from my local to my remote server and some images are showing up others are getting a 500 error. Using Version 3.0.0-rc4 This is showing up as the last stacktraces in storage/logs/laravel.log ...

[Twill2] Do settings section support media and how?

As title says, is it possible to inject media here or should I make a custom settings singleton to handle this use case?