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

    tfilos

    11/01/2022, 4:14 PM
    Hey, if I'm rendering related items inside of a block, I should be able to use collection methods like
    sortBy
    on the results, right? It looks like a Collection instance, but I'm not getting any different result when I try for example to sort by the text field 'artist'
    $block->getRelated('albums')->sortBy('artist')
  • i

    ifox

    11/01/2022, 4:15 PM
    hey @tfilos yes you should get a collection from getRelated, do you see the artist attribute in the items of that collection?
  • t

    tfilos

    11/01/2022, 4:15 PM
    Just want to verify I'm not looking in the wrong place
  • t

    tfilos

    11/01/2022, 4:16 PM
    Yes!
  • t

    tfilos

    11/01/2022, 4:16 PM
    Okay, if it's indeed a collection then I'll dig deeper on the Laravel side, thanks
  • t

    tfilos

    11/01/2022, 4:19 PM
    Right, there we go. Just a combination of case sensitive sorting + a really improbably set of values. Thanks again, just wanted to verify there wasn't any sort of innate feature that might be overriding/affecting, etc
  • h

    Hip-Hop

    11/02/2022, 5:21 AM
    Good morning, please tell me how to allow a certain role access to CMS Users?
  • h

    Hip-Hop

    11/02/2022, 6:02 AM
    Added a role to the provider
    Copy code
    Gate::define('manage-users', function ($user) {
                 return $this->authorize($user, function ($user) {
                     return $this->userHasRole($user, [UserRole::ADMIN, UserRole::SECURITY]);
                 });
             });
    Now the user with the security role has a menu item users cms But when I go, it says I don't have access.
  • h

    Hip-Hop

    11/02/2022, 7:34 AM
    @ifox Good afternoon! Looking through the questions, I found that you previously wrote that one of the clients wanted a role where only drafts could be created. Can you tell me how did you implement it? Is it possible to pass some parameter via formData so that a certain role always has access to saving to a draft?
    p
    • 2
    • 5
  • k

    kalle

    11/02/2022, 8:00 AM
    I have created small blog post on this, but its small approve system, idk if this is what you want. But you can check it anyway. https://blog.izetmulalic.com/twill-custom-approve-system/
  • p

    pboivin

    11/02/2022, 9:57 PM
    Draft only user roles
  • t

    thingasd

    11/07/2022, 6:22 AM
    Hey guys, is that way to remove tag in twill?
  • h

    Harings Rob

    11/07/2022, 7:48 AM
    Hey @thingasd out of the box there is no ui for Tags.
    t
    • 2
    • 11
  • a

    antonioribeiro

    11/08/2022, 12:56 PM
    Hey @Harings Rob , I just changed this Capsule to make it Composer installable: https://github.com/area17/twill-capsule-feature-flags, and it's working fine, but my question is: can we make the Capsule find the views on also on
    src/resources
    directly, along with
    src/CapsuleName/resources
    ? In order to have everything on the /src (instead of Twill/Capsules/CapsuleName), I overloaded the ServiceProvider: https://github.com/area17/twill-capsule-feature-flags/blob/main/src/ServiceProvider.php
    h
    • 2
    • 6
  • t

    thingasd

    11/09/2022, 7:36 AM
    Hey thingasd5199 out of the box there is
  • a

    amargoCactus

    11/10/2022, 1:45 AM
    Twill Settings is reworked in 3.0?
  • a

    amargoCactus

    11/10/2022, 1:45 AM
    Or not yet?
  • i

    ifox

    11/10/2022, 3:03 AM
    yes it is @amargoCactus https://twill.io/docs/3.x/settings-sections/
  • i

    ifox

    11/10/2022, 3:07 AM
    you can use all fields in settings now, including the block editor and repeaters. as they are now powered by blocks
  • a

    amargoCactus

    11/10/2022, 3:38 AM
    awesome, is there an upgrade guide?
  • i

    ifox

    11/10/2022, 3:45 AM
    https://github.com/area17/twill/blob/3.0.0-beta2/UPGRADE.md
  • a

    amargoCactus

    11/10/2022, 3:45 AM
    thanks!!!!
  • e

    elkex

    11/10/2022, 1:40 PM
    How can it be that my app()->getLocale() shows my page slug instead of the language code?
  • i

    ifox

    11/10/2022, 1:43 PM
    Hi @elkex are you sure? That doesn't seem possible
  • i

    ifox

    11/10/2022, 1:44 PM
    unless you've used setLocale with a slug as parameter for some reason
  • e

    elkex

    11/10/2022, 1:46 PM
    It was something very weird... I managed to fix it, but however, I'm using translatable fields and if I DD the element, I get translatedAttributes in my json, but if I don $element->title, I do not get the title back
  • e

    elkex

    11/10/2022, 1:47 PM
    Weird things happening.. But this is also fixed, well nevermind haha
  • e

    elkex

    11/10/2022, 1:48 PM
    Last question.. How do I return pages with subpages logically? Is there a build-in function or relation or do I write it myself?
  • k

    kalle

    11/10/2022, 2:06 PM
    Can you explain this? Which Twill features do you use.
  • y

    Young_Koekwaus

    11/11/2022, 4:56 PM
    question .... is there a way to have this always open ?
1...422423424...484Latest