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

    ckmirafss

    06/10/2022, 11:46 PM
    It worked! Thank you so much!
  • d

    dedli

    06/11/2022, 4:44 AM
    Hi guys ) Is it another way to set this data global for frontend and for all admin preview. https://monosnap.com/file/3bscukpr4tTgEwV5XvGc0ZmdXHKNWc
  • d

    dedli

    06/11/2022, 5:02 AM
    Could you please tell how can i validate quantity of blocks in request class? Thanks
  • i

    ifox

    06/11/2022, 7:22 AM
    @dedli check view composers in Laravel docs
  • i

    ifox

    06/11/2022, 8:50 AM
    for blocks quantity you can use standard rules, knowing that a blocks key is coming in the input and that it is an array
  • i

    ifox

    06/11/2022, 8:50 AM
    what you might struggle with is the validation message so that the user understands why it's not valid
  • i

    ifox

    06/11/2022, 8:50 AM
    which is something we want to improve in the future
  • d

    dedli

    06/11/2022, 9:41 AM
    That is great! I do not know about it ( Thanks a lot!
  • d

    dedli

    06/11/2022, 3:23 PM
    Sorry ( Can you explain how should i do it. Validation I can do inside block class or in view. In both cases it is array with rules. What rule should I set for such task? I watch here https://twill.io/docs/block-editor/validating-blocks.html#blade-directive
  • i

    ifox

    06/11/2022, 6:23 PM
    @dedli these are for validating what's inside the block. If you want to validate the number of blocks, you'll need to do that in the form request class.
  • i

    ifox

    06/11/2022, 6:25 PM
    ['blocks' => 'max:5']
  • d

    dedli

    06/12/2022, 4:17 AM
    Thanks ) If i understand you right, this will validate all blocks quantity. In my case I want validate quantity of certain block.
  • d

    dedli

    06/12/2022, 6:05 AM
    I have module searchTags his route is /settings/searchTags. And I have another two modules witch have browser searchTags. I add to browser formField
    Copy code
    'routePrefix' => 'settings'
    . I can add tags in browser but after reload page all selected tags are lost, so they are not saved. Should I add something addition for saving? They should be stored in related table?
  • d

    dedli

    06/12/2022, 6:07 AM
    And one more ) Am I understand right that build in functionality tags visible only inside one module. So if I need site global tags I should create new module for this?
  • h

    Harings Rob

    06/12/2022, 7:17 AM
    I think it is best to create a custom validator for that. Check laravel docs how to do that
  • d

    dedli

    06/12/2022, 1:10 PM
    Thanks, I understand now ) What about previous questions about browser?
  • i

    ifox

    06/12/2022, 2:36 PM
    how are you saving the browser in the module's repository?
  • i

    ifox

    06/12/2022, 2:36 PM
    you're correct about creating your own module for global tags
  • d

    dedli

    06/12/2022, 3:30 PM
    Sorry 😔 How should I do? I thought saving is automaticaly and automaticaly save related item to related table. I did not find anything about saving in docs (
  • d

    dedli

    06/12/2022, 3:31 PM
    Thanks )
  • i

    ifox

    06/12/2022, 5:40 PM
    you don't have anything to do for it to save if its in a block. But if it's not, you need to configure it.
  • i

    ifox

    06/12/2022, 5:49 PM
    https://twill.io/docs/form-fields/browser.html#using-browser-fields-as-related-items
  • d

    dedli

    06/13/2022, 3:40 AM
    Yes I configure it at the begging. The problem was the name of the browser. Name field should be the same as module name
    Copy code
    'moduleName' => 'searchTags','name' => 'searchTags',
    than it is save. In the docs name set with underscore https://monosnap.com/file/ASax5220vhcceUkVQQhgNbFBBi6cYf and this case does not work for me.
  • i

    ifox

    06/13/2022, 7:41 AM
    https://github.com/area17/twill/blob/5d3f7f15f65f05436f9eb542d11ea01b9ba3fd77/src/Repositories/Behaviors/HandleRelatedBrowsers.php#L21
  • a

    afatmustafa

    06/13/2022, 8:21 AM
    Hi community! I hope you are all fine
  • a

    afatmustafa

    06/13/2022, 8:22 AM
    I have a quick question when you select something from Multi select field, the browser tab freezes instantly. It was working before. There is no error in the console, what do you think could be the reason?
  • d

    dedli

    06/13/2022, 8:41 AM
    Thanks!
  • i

    ifox

    06/13/2022, 8:49 AM
    when you say it was working before do you mean before updating Twill?
  • a

    afatmustafa

    06/13/2022, 8:57 AM
    No, I haven't even turned on the computer on which I did this project for 2 weeks, and there was no update.
  • a

    afatmustafa

    06/13/2022, 8:58 AM
    I thought it might be because of the new content entered, but I tried it with the old database, still the same error.
1...343344345...484Latest