https://twill.io logo
Join Discord
Powered by
# ❓questions
  • i

    ifox

    10/06/2022, 12:57 PM
    If you don't want the current locale to apply then yes you'd have to explicitly use the locale that should be used. Not sure how your routes are setup to answer better. Do you have the locale as part of the url?
  • i

    ifox

    10/06/2022, 12:57 PM
    You can set validation rules in the block file itself
  • i

    ifox

    10/06/2022, 12:58 PM
    https://twill.io/docs/block-editor/validating-blocks.html#blade-directive
  • d

    dedli

    10/06/2022, 1:00 PM
    Thanks. Yes, I have locale prefix in my url and i need depend on locale change only url prefix, and do not change slugs
  • i

    ifox

    10/06/2022, 1:04 PM
    In the CMS UI you can set the slug in all languages to be the same, but it seems like you want to retrieve the record in the locale of the url but with the slug of your main language. I would then retrieve the model by slug without considering current locale and then retrieve the current locale translation. Much easier to ask your admin users to set the same slug on all languages I think.
  • i

    ifox

    10/06/2022, 1:05 PM
    fyi it's better for your slugs to be translated for SEO
  • d

    dedli

    10/06/2022, 1:16 PM
    thanks a lot! I will set the same slug on all languages.
  • e

    EP_Informatyka

    10/06/2022, 4:09 PM
    DESC: I prepare a page module with Self-nested, after update copoeser.jspn packages they print error below ERR: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated cms.twill/vendor/area17/twill/src/Http/Controllers/Admin/ModuleController.php#1504 Laravel V: 9.34 PHP V: 8.1.10 Twill V: 2.9 How fix this issue ?
  • j

    JeanSilva

    10/06/2022, 9:15 PM
    Hi, I have assumed a site created by another employee in my company that is in twill, and I've didn't built anything on it. We are having a problem with the password recovery link that is automatically created. The problem is that whenever someone with the link tries to create the password, is shows an error message "invalid token". Also, if I destroy this user and create another new user with the same credentials, when I enable, it doesn't show the token link. I have some questions: -> does the password link with token expire? I didn't found it on the twill documentation. -> is there a way to generate this link again?
  • c

    ckmirafss

    10/06/2022, 10:37 PM
    Hi, so my client has their database set up in JSON format. Is it possible to pull it on twill? Please see the attached.
  • s

    saeed-sikandar

    10/06/2022, 10:39 PM
    I want to add HasRevision in feature in one of my module how do I add manually https://twill.io/docs/1.x/#revisions-and-previewing I follow this guide but nothings happens any suggestion ? please
  • i

    ifox

    10/06/2022, 10:50 PM
    Twill is using Laravel models and so standard relational database tables. If you know how to read json and insert the data in your database, then Twill will work on top without any issues.
  • i

    ifox

    10/06/2022, 10:51 PM
    I would suggest creating a new module with revisions enabled so you can see what is needed
  • i

    ifox

    10/06/2022, 10:52 PM
    basically the trait, a revisions model and a revisions table
  • c

    ckmirafss

    10/06/2022, 10:52 PM
    I know how to show it on the front end, but I am just wondering how to save the fields as json via Twill.
  • i

    ifox

    10/06/2022, 10:52 PM
    Welcome email token does expire. Users can use forgot password from the login screen to get a new email with a valid token.
  • s

    saeed-sikandar

    10/06/2022, 10:54 PM
    Alright thankyou 👍
  • i

    ifox

    10/06/2022, 10:54 PM
    Not sure what you mean, do you need to have forms in twill to edit that once it's imported from json? Or do you want one field in a twill form to input and save json?
  • c

    ckmirafss

    10/06/2022, 10:55 PM
    Both sir.
  • i

    ifox

    10/06/2022, 10:56 PM
    create a twill module with the form that correspond to the data, import the data into the table of that module, and that's it
  • h

    Hip-Hop

    10/07/2022, 8:43 AM
    Good afternoon, I have already written about this issue before? What am I doing wrong Why is the validation not working?
  • i

    ifox

    10/07/2022, 8:45 AM
    Hi @Hip-Hop that is not how blocks should be validated
  • i

    ifox

    10/07/2022, 8:46 AM
    https://twill.io/docs/block-editor/validating-blocks.html#blade-directive
  • h

    Hip-Hop

    10/07/2022, 8:49 AM
    @ifox Everything is now up to me, thank you very much.
  • h

    Hip-Hop

    10/07/2022, 9:30 AM
    how to check the image? public $rulesForTranslatedFields = [ 'header_block' => 'required|string', 'description_block' => 'required|string', 'medias.image_block' => 'required|image|mimes:jpg,png,jpeg,gif,svg|max:2048', ];
  • h

    Hip-Hop

    10/07/2022, 9:38 AM
    English and Russian fields are filled
  • h

    Hip-Hop

    10/07/2022, 9:39 AM
    'header_block' => 'required|string', 'description_block' => 'required|string', 'image_block' => 'required|image|mimes:jpg,png,jpeg,gif,svg|max:2048',
  • i

    ifox

    10/07/2022, 12:20 PM
    You'll need to validate it in non translated rules
  • i

    ifox

    10/07/2022, 12:21 PM
    also image, extension and size validation won't work since you're not actually receiving a file here, only a reference to a record from the media library
  • j

    JeanSilva

    10/07/2022, 12:40 PM
    thanks for the help. Another question if I may haha. Can I change the expiration time of the tokens? Currently I don't know where are the code.
1...412413414...484Latest