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

    ifox

    06/01/2022, 11:28 AM
    then indeed it is currently missing that functionality
  • d

    dedli

    06/01/2022, 11:31 AM
    Ok, thanks )
  • a

    anmsid

    06/01/2022, 2:49 PM
    Hi, is there anyway to restrict buckets for featuring content to certain user role only? or perhaps a least there's bucket activity log just like in the module revisions, so we can see who just added or removed items in the buckets.
  • i

    ifox

    06/01/2022, 6:02 PM
    hi @anmsid you could restrict access to the buckets section of the CMS based on user role, but if you are looking to have revisions I'd recommend a singleton module with browsers fields instead of buckets.
  • a

    anmsid

    06/02/2022, 1:52 AM
    Thanks for the reply. Restricting access to the buckets should be sufficient for now, but how do I do this? I tried adding 'can' => 'admin-only' (I have defined the gate in AuthServiceProvider) in the twill config buckets sections but it doesn't work.
  • i

    ifox

    06/02/2022, 8:38 AM
    hi @anmsid it would be in the twill navigation entry that you'd use 'can'
  • d

    dedli

    06/02/2022, 1:27 PM
    Hi guys, can you help me ) How can I redifine this title https://monosnap.com/file/9OUZ3KkPQHS1JPareWeFyMZmbDsWwo
  • k

    kalle

    06/02/2022, 1:29 PM
    You need option enabled to edit it? Question, is this a singleton?
    Copy code
    php
    // Controller
    protected function formData($request)
    {
      return [
        'editableTitle' => true,
      ];
    }
  • d

    dedli

    06/02/2022, 1:59 PM
    It is not a singleton. Just section of settings. It will be great rename it or remove this titlle at all )
  • i

    ifox

    06/02/2022, 3:21 PM
    you can pass a customTitle variable to the layout in your settings blade file
  • d

    dedli

    06/02/2022, 4:56 PM
    Thanks! )
  • d

    dedli

    06/02/2022, 8:45 PM
    Is it possible to set a limit to the content block and add the possibility to manager select it only once? I have block with form and I need to render this block only once but it can be in the different page parts.
  • i

    ifox

    06/02/2022, 8:47 PM
    you could validate it from the form request class, but at the moment the UI doesn't have a feature preventing to use certain blocks more than once. It is on the roadmap.
  • d

    dedli

    06/02/2022, 8:48 PM
    ok, thank you)
  • c

    ckmirafss

    06/05/2022, 10:02 AM
    Hello All, I've create a singleton module and added these medias field (Clients)... On the frontend side, how do we display these clients images? TIA!!!
  • i

    ifox

    06/05/2022, 10:41 AM
    hi @ckmirafss, you'd need to get that singleton record from db and then call ->image helpers on it. In your case assuming the field is called clients and you have a crop named default,
    $singleton->images('clients', 'default')
    would return a list of image urls
  • g

    Gvido Blue Fox

    06/05/2022, 8:29 PM
    Hi! I create new project with twill. I didn't set up AWS work, but...
  • i

    ifox

    06/05/2022, 9:34 PM
    Hi @Gvido Blue Fox make sure to use:
    Copy code
    MEDIA_LIBRARY_ENDPOINT_TYPE=local
    FILE_LIBRARY_ENDPOINT_TYPE=local
  • a

    amargoCactus

    06/06/2022, 3:07 AM
    can i get the medias from a record with eloquent?
  • a

    amargoCactus

    06/06/2022, 3:07 AM
    or query builder
  • d

    dedli

    06/06/2022, 4:44 AM
    Hi guys ) I have moodule pages. I put it's view in site/page.blade.php. Preview not open and give error. I searched this topic here in chat and find it, but all my tries didn't gave expected result. If i remove pagefrom site/page, preview opens but give error that I should add site/page.blade.php to make it works https://monosnap.com/file/0YMWMZEiCwmMNFqxtCBHQqx95IjeGJ
  • c

    ckmirafss

    06/06/2022, 6:02 AM
    Thank you for your response! Can you please see my code? It just show 1 client on FE side.
  • i

    ifox

    06/06/2022, 8:23 AM
    @ckmirafss use imageS inside a foreach loop
  • i

    ifox

    06/06/2022, 8:23 AM
    ->imageObject
    would do that, or directly query the Media model
  • d

    dedli

    06/06/2022, 8:27 AM
    Now, when i click preview button I have error that there is no variable https://monosnap.com/file/RsuJTg4ydOcrRhF5yAf13ZMsPDnOVX
  • i

    ifox

    06/06/2022, 8:29 AM
    Hi @dedli inside the preview the record is called
    $item
    . You can customize the preview by implementing
    previewData
    in your admin controller. In there you can
    return ['page' => $item];
    which should just work in your case
  • d

    dedli

    06/06/2022, 8:34 AM
    Now I have problems with my layouts variables https://monosnap.com/file/5e7he5SnRm0u4cDgCfm3MHEcWoY9SK
  • i

    ifox

    06/06/2022, 8:37 AM
    it sounds like you're giving this view more data than just the page model you're on. so same thing, you need to send it from previewData yourself because the backend is not calling your frontend controller. You can of course share the same code from your frontend controller and admin preview method by putting that code in your module's repository class for example
  • d

    dedli

    06/06/2022, 9:03 AM
    Am I understanding you right, if I want to use preview all my data should be or from my current model or I should force add it inside my admin controller inside method previewData()?
  • i

    ifox

    06/06/2022, 9:04 AM
    that's correct. by default the preview only gets access to an
    $item
    variable.
1...336337338...484Latest