TC
Twill CMSluciusvorenus_

[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. However, I would have thought that when including... $form = parent::getForm($model); ...at the start, it might have maintained such functionality. I notice that the parent function just returns a new form, so wondering at which point the js creating the automated permalink behaviour needs / should be injected to maintain functionality. Maybe this is the intended behaviour and not a bug?
I
ifox•397d ago
Input::make()
->name('title')
->label('My title field')
->translatable()
->onChange('formatPermalink'),
Wysiwyg::make()
->name('description')
->label('Descrription')
->translatable(),
Input::make()
->name('slug')
->label(twillTrans('twill::lang.modal.permalink-field'))
->translatable()
->ref('permalink')
->prefix($this->getPermalinkPrefix($this->getPermalinkBaseUrl())),
Input::make()
->name('title')
->label('My title field')
->translatable()
->onChange('formatPermalink'),
Wysiwyg::make()
->name('description')
->label('Descrription')
->translatable(),
Input::make()
->name('slug')
->label(twillTrans('twill::lang.modal.permalink-field'))
->translatable()
->ref('permalink')
->prefix($this->getPermalinkPrefix($this->getPermalinkBaseUrl())),
see onChange on the title, and ref on the slug field
L
luciusvorenus_•397d ago
Thanks @ifox.dev. Totally missed that, partly with Guides being a separate top level section. I thought I remembered see something about it in the old docs. Apologies
I
ifox•397d ago
all good, and yes some guides could be merged into the docs
L
luciusvorenus_•397d ago
They might, but there might be value in expanding the range of guides, and keeping the terser docs section. The challenges for documentation in general is to address both 'how' to use / implement a feature, but also, 'why' would I need to use that feature. Keeping a separation between learning for the complete noobs (guides; why) and and the intermittant knowedgeable users (docs; how). They rest of you can just go to the API refs whenever you get old and your memory starts to fail! 😜
I
ifox•397d ago
for that last part IDE completions too the blade approach for forms and a lot of configuration based feature on Twill 2 wasn't allowing a lot of that but on Twill 3, everything is right there
L
luciusvorenus_•397d ago
Absolutely right. Very handy to pop along to the class file for the function.
I
ifox•397d ago
for example, in the setup method of the controller $this->dis would show all the features that can be disabled
L
luciusvorenus_•397d ago
I'm a long time user of PHPStorm. Not only completion, but also the class insertion. I don't know how many times I saw something pop up on a list of available functions and thinking 'Oh, there's a function to do that'.
Want results from more Discord servers?
Add your server
More Posts
multi select selected optionsI'm using the multi select as documented in https://twill.io/docs/form-fields/multi-select.html#mult[3.0.0-rc4] - How to show current value in a select form fieldCurrently I have my select field defined as: `@formField('select', [ 'name' => 'work_year', [3.0.0-rc4] Images not found on remote server - League\\Glide\\Filesystem\\FileNotFoundExceptionI just went from my local to my remote server and some images are showing up others are getting a 5[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 h[3.x.dev] Call to undefined method ReflectionUnionType::getName()Newbie to Twill here. Fresh install of Laravel 10.4.1 / PHP 8.2.4 / MYSQL 8.0.32 on Ubuntu Budgie 2Add custom icons into twillI add the icons into the path `resource/views/admin/icons` and I run the command, result is ok, but Select an another block in a block?Hi everyone, I have a function to create a new block with name "Columns block". With this block, usMedia Library / Glide only loading JPEGsHey there, So I had a Laravel/Twill app running successfully on a subdomain with no issue. Today IAdding a vue componentGood afternoon Tell me what could be the problem? On the main page of the admin panel there is an aSave title in translationsI'm trying to save my title as a translatable field, normal fied works fine but when i make it transSet translations to activeWhile trying to set translations to active it isn't saved to database? Only english is selectablecan't use Published, Draft, Trash filters on module indexI see the buttons, they show the correct counts in the parenthesis, but when I click on them, I alwamedias XHR request with wrong schemeGreetings... I'm having trouble with accessing media library in the admin area in production. Mixeremove positioning and nesting from the page indexGood morning. Tell me how to remove positioning and nesting from the page index in the admin panel? Connecting additional fields depending on the value in the record when selected in the browser compoGood morning. Can you tell me if it is possible to implement the doing in twill? I have a browser iCustom function in a Module ControllerI need to trigger a custom function that is run after a user clicks "Update" for a post in a Twill mTiptap WYSIWYGHi everyone, I would like to know if there is a way to use toolbar align options with tiptap type wySorting by a translation field (ie, title)Hi everyone, I feel like I must be missing something simple (as usual) or am making something overlyProblem with displaying headers if the site is in two languagesGood morning. I decided to look at twill 3 version. I use two languages (ru-main, en-I want to add Issuing rights to upload to the media libraryGood afternoon! Tell me how to give the right dip for the defined role to upload files / images to t