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

    bwaltz6

    06/01/2021, 3:58 PM
    Question about feature buckets. I had to dig to find the FeatureController.php to find how to search when your index field is something other than $title. My Posts module has a $headline field instead. I found that you can accomplish this by adding
    'searchField' => 'headline',
    to bucketables in twill.php. I also don't see a way to change the field that's returned in the available items list. It looks like on line 190 of FeatureController.php it is hard coded to only use $title:
    'name' => $item->titleInBucket ?? $item->title,
    . I also don't know how to get thumbnails to work.
  • i

    ifox

    06/01/2021, 4:01 PM
    Copy code
    public function getTitleInBucketAttribute()
    {
      return $this->headline;
    }
  • i

    ifox

    06/01/2021, 4:04 PM
    for the thumbnails, it should use the first media attached by default
  • b

    bwaltz6

    06/01/2021, 5:15 PM
    @User do I put that code in the model?
  • i

    ifox

    06/01/2021, 5:16 PM
    yes, it's a Laravel model accessor
  • b

    bwaltz6

    06/01/2021, 5:32 PM
    yes, awesome, that fixed it
  • b

    bwaltz6

    06/01/2021, 6:13 PM
    The thumbs are a little smushed as squares. Is there a way to specify the ratio?
  • i

    ifox

    06/01/2021, 6:14 PM
    ha, not for this specific location unfortunately, that could definitely become an option though
  • b

    bwaltz6

    06/01/2021, 7:38 PM
    Is there a way to do conditional field display? For example, only show an image field if another checkbox is checked
  • i

    ifox

    06/01/2021, 7:57 PM
    yes @User, there's a Blade component helper for that, see https://github.com/area17/twill/issues/39#issuecomment-426067947
  • b

    bwaltz6

    06/01/2021, 8:00 PM
    🙌
  • w

    wicky

    06/02/2021, 7:47 AM
    anybody encountering the same error with laravel 8 / php 8 + twill 2.2.1?
  • r

    Rayderxx

    06/02/2021, 7:53 AM
    does it work with php7.4 ? 😄
  • w

    wicky

    06/02/2021, 7:55 AM
    for sure!
  • w

    wicky

    06/02/2021, 7:55 AM
    we are using it in production
  • d

    Dmi3yy

    06/02/2021, 8:00 AM
    Try use array like that:
    Copy code
    @component('twill::partials.form.utils._connected_fields', [
            'fieldName' => 'type',
            'fieldValues' => ['2','3'],
            'renderForBlocks' => false # (depending on regular form vs block form)
        ])
    but not work, if fieldValues string and one then work correct
  • d

    Dmi3yy

    06/02/2021, 8:03 AM
    https://tppr.me/STTEF
  • d

    Dmi3yy

    06/02/2021, 8:03 AM
    https://tppr.me/SZJ02
  • w

    wicky

    06/02/2021, 8:16 AM
    I solved it by published the vendor files and wrapping a collect type around the options like so: '$options = collect($options);'
  • i

    ifox

    06/02/2021, 8:24 AM
    there is an open PR fixing arrays in the connected field
  • i

    ifox

    06/02/2021, 8:26 AM
    Do you mean that this fails in PHP 8 for you but not PHP 7.4? In any case you shouldn't have to override the view just to add a collect, you can do that when you use the field in your form or from your controller, depending on how you feed the select options.
  • i

    ifox

    06/02/2021, 8:27 AM
    oh ok I see
  • i

    ifox

    06/02/2021, 8:30 AM
    we'll need to add
    is_object($options)
    for PHP 8 to not complain about this
  • w

    wicky

    06/02/2021, 8:45 AM
    Yes it fails in PHP8, 7.4 is working fine! Thanks 🙂
  • i

    ifox

    06/02/2021, 9:22 AM
    Actually this has already been addressed: https://github.com/area17/twill/commit/ad22ed919e8dcb1614b0e09942150dc259dce463#diff-b7151ce23e32e6f3421584eae4b33a09eabd7ee0925abbfc9839fbda4f2aef8d
  • i

    ifox

    06/02/2021, 9:23 AM
    you might want to clear Laravel's views cache, or update your published Twill views
  • i

    ifox

    06/03/2021, 2:41 AM
    2.3 is out!
  • u

    user

    06/03/2021, 7:37 AM
    hi all happy to be here i have a few doubts does this package work exactly like how the wordpress front-end CMS works like ?
  • i

    ifox

    06/03/2021, 8:25 AM
    Hi @User can you clarify what you mean by how Wordpress work? There are many ways to work with Wordpress so I'm wondering what's driving your question. It is not really the same, though there are definitely similarities one could find.
  • u

    user

    06/03/2021, 8:25 AM
    wordpress is a CMS
1...181920...484Latest