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

    ifox

    07/06/2021, 1:15 PM
    you can still use the configuration approach in the latest version
  • i

    ifox

    07/06/2021, 1:17 PM
    I think your problem is that you have a blade file under
    views/admin/blocks
    that isn't defined in your config, and also doesn't have any annotation in the file itself which would allow it to not be defined in config
  • i

    ifox

    07/06/2021, 1:17 PM
    if that makes sense
  • i

    ifox

    07/06/2021, 1:17 PM
    @User by block view I just meant the one that is producing the error
  • u

    user

    07/06/2021, 1:29 PM
    I'm pretty sure that all of these are named correctly
  • u

    user

    07/06/2021, 1:29 PM
    They are all directly from the tutorial, and they are named the same as in
    twill.php
  • p

    pboivin

    07/06/2021, 1:32 PM
    Yep, looks good. Can you reduce it to just one block (eg.
    paragraph
    ) and make that work?
  • u

    user

    07/06/2021, 1:33 PM
    Sadly no, no matter which one of them I leave the error persists, when I delete everything and just leave an empty folder,
    php artisan
    works again.
  • i

    ifox

    07/06/2021, 1:35 PM
    even if you're adding
    @twillBlockTitle('Paragraph')
    in the block blade file itself? there might be a bug with the configuration approach (not aware of any though), but the annotation approach should definitely work
  • u

    user

    07/06/2021, 1:36 PM
    No not quite, I'm still trying to use the legacy code. I've made a sandbox Laravel application just to get into twill as much as possible because there's a different project I'm supposed to update which uses the older version of twill.
  • p

    pboivin

    07/06/2021, 1:36 PM
    What if you delete your current blocks and run
    php artisan twill:make:block mytest
    , can you get that to work?
  • u

    user

    07/06/2021, 1:36 PM
    @User Yes, that worked.
  • u

    user

    07/06/2021, 1:46 PM
    After adding directives, similar to mytest.blade.php, it works, but does that mean there's something wrong with backward compatibility?
  • i

    ifox

    07/06/2021, 1:57 PM
    there might be, we will check what's happening
  • u

    user

    07/06/2021, 1:59 PM
    Hey what is the best option for relationships? I want to add a
    category
    to my
    post
    . Should I add a select and pass the option via
    formdata
    ? Or is there a better way?
  • p

    pboivin

    07/06/2021, 2:11 PM
    @User A browser field through the built-in
    related
    table is my favorite option
  • p

    pboivin

    07/06/2021, 2:14 PM
    A quick update to the docs in underway, to document this use case a bit more : https://github.com/area17/twill/blob/c6a6431d52b39eebf41c2e041e06648c9b81f18d/docs/.sections/form-fields.md#using-browser-fields-as-related-items
  • u

    user

    07/06/2021, 2:19 PM
    Thanks @User ill have a look 🙂
  • u

    user

    07/06/2021, 2:33 PM
    How load to load the featured content in my controller?
  • u

    user

    07/06/2021, 2:33 PM
    I did configure it and it seems to work but I want to render it now
  • u

    user

    07/06/2021, 2:34 PM
    I can only fund this method on the repo and nothing about buckets
  • i

    ifox

    07/06/2021, 2:36 PM
    https://github.com/area17/twill/blob/4c3db071a4655cfb0cf5d4f5911521a3ccc255c8/src/Models/Feature.php#L22
  • i

    ifox

    07/06/2021, 2:36 PM
    Feature::forBucket("bucket-name")
  • u

    user

    07/06/2021, 2:37 PM
    Aaah it is based in the model
  • u

    user

    07/06/2021, 2:37 PM
    I see 🙂
  • i

    ifox

    07/06/2021, 2:37 PM
    polymorphic again, your bucket could contain multiple types
  • u

    user

    07/06/2021, 2:38 PM
    Yea gotta get used to Poly's I build application where it is not really needed but in this case it is often used and I forgot it is a thing.
  • u

    user

    07/06/2021, 2:38 PM
    Also how does Poly's affect peformance?
  • u

    user

    07/06/2021, 2:48 PM
    But now I need to query 4 buckets?
  • u

    user

    07/06/2021, 2:48 PM
    Maybe I understand it right
1...464748...484Latest