Skip to content

Disable auto-slugify #983

Answered by pboivin
geff21st asked this question in Q&A
Jun 18, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey @geff21st,

If you want to "unlink" the title and permalink fields, you can override your module's create partial and comment out the onChange option :

resources/views/admin/mymodule/create.blade.php

@formField('input', [
    'name' => $titleFormKey ?? 'title',
    'label' => $titleFormKey === 'title' ? twillTrans('twill::lang.modal.title-field') : ucfirst($titleFormKey),
    'translated' => $translateTitle ?? false,
    'required' => true,
    // 'onChange' => 'formatPermalink'
])

@if ($permalink ?? true)
    @formField('input', [
        'name' => 'slug',
        'label' => twillTrans('twill::lang.modal.permalink-field'),
        'translated' => true,
        'ref' => 'permalink',
 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@geff21st
Comment options

Answer selected by geff21st
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants