https://twill.io logo
Join Discord
Powered by
# 🔮twill-3
  • i

    ifox

    04/23/2023, 11:28 AM
    Draft outline here: https://workflowy.com/s/updated-twill-docs-o/XWQeg2DdoDnSeNnx
  • l

    Lucius Vorenus

    04/23/2023, 11:43 AM
    That's really useful. On my reading list and I'll try and get time to have a closer look at it later. Thanks for sharing.
  • t

    Tobi Wan

    04/25/2023, 1:04 AM
    Hi, how do I check if there is an image set with
    ->image('image')
    it seems that
    ->image('image')
    always returns an image even when there is no image set.
  • i

    ifox

    04/25/2023, 1:05 AM
    ->hasImage
  • t

    Tobi Wan

    04/25/2023, 1:10 AM
    awesome. thanks
  • l

    Lucius Vorenus

    04/25/2023, 9:06 AM
    Hey @Tobi Wan ! @ifox gave me great advice about checking out the behaviours, in this case
    A17\Twill\Models\Behaviors\HasMedias
    Sorry, @ifox . I've had no questions for you the last couple of days, thanks to your patient replies the few days before. The more I see and understand Twill, the more impressive it becomes. 👍
  • z

    zeenux

    04/25/2023, 2:30 PM
    I did the same, dug into the API documentation and found out the solution
  • s

    Smilodown

    04/26/2023, 8:01 AM
    Hi everyone, this is my first try on Discord, i don't really know how it works .... i'm getting old with my 37yo. Could someone explain me why building form with blade template don't work. It only works with controllers methods like getForm(), getSideFieldsets(). In addition, I'd like to customize titles from my fieldsets but I don't know how to perform with. Apologizes for my bad english ! Thanks by advance. Vincent.
  • s

    Smilodown

    04/26/2023, 8:05 AM

    https://cdn.discordapp.com/attachments/989876822323908608/1100694202200887296/Capture_decran_2023-04-26_a_10.03.02.png▾

  • s

    Smilodown

    04/26/2023, 8:30 AM
    OK well, I found the solution. for blade templates, which was is the comments in the controller ... poor me ! But I decide to use the controller for building forms, I don't have the solution to customize titles for fieldsets and sidefieldsets. Thanks for any help.
  • k

    kerkness

    04/26/2023, 1:42 PM
    Here's an example from one of my controllers.. HTH
    Copy code
    public function getSideFieldsets(TwillModelContract  $model) : Form
        {
            $side = parent::getSideFieldsets($model);
    
            $seoFields = Fieldset::make()->title('SEO')
                ->fields([
                    Input::make()->name('seo_title')->label('SEO Title')->translatable(),
                    Input::make()->name('seo_description')->label('SEO Description')->translatable()
            ]);
    
            $side->add(Medias::make()->name('profile_image')->label('Profile Image'));
            $side->addFieldset($seoFields);
    
            return $side;
        }
  • Media save issue
    d

    Defenestrația

    05/02/2023, 6:29 PM
    I have a singleton with medias and I have two medias fields defined. When I attach images to the singleton, it appears to work fine and saving works. The database has the correct images, but when I refresh the page both medias fields have no images attached. If I save again, my image attachments are lost. Any idea what would cause this?
    i
    • 2
    • 17
  • t

    thelongestsigh

    05/02/2023, 6:46 PM
    How can i display a block in block?
  • Published status issue
    n

    Navid

    05/03/2023, 10:45 AM
    can somebody help me please? I want to show published status in the table view . as documentation is written I add this column like the below $columns->add( PublishStatus::make() ); Published column is added in the table and his functionality is correct, but title and bullet color is not changed as the data change. always title is "unpublish" and the bullet color is green. could some body help me to fix this problem?
    i
    • 2
    • 18
  • n

    Navid

    05/03/2023, 11:44 AM
    please is there somebody to help me, I struggled almost 2 days and I can not fix this problem
  • k

    kalle

    05/03/2023, 12:02 PM
    Are current default locale and DB field locale equal?
  • k

    kalle

    05/03/2023, 12:02 PM
    https://twillcms.com/docs/block-editor/nested-blocks.html
  • k

    kalle

    05/03/2023, 12:04 PM
    Im not too familiar with the new 3.x so Ill cc @ifox
  • n

    Navid

    05/03/2023, 1:13 PM
    Thanks
  • j

    jefsev

    05/03/2023, 2:34 PM
    Anybod have a quick way to update all tables with a prefix twill_ ? I updated from 3.0.0-rc3 to 3.0.1 and now nothing works 😮
  • i

    ifox

    05/03/2023, 2:50 PM
    @jefsev https://discord.com/channels/811936425858695198/989876822323908608/1092791771978792980
  • i

    ifox

    05/03/2023, 2:51 PM
    also https://discord.com/channels/811936425858695198/811936425858695201/1101196080709914659
  • j

    jefsev

    05/03/2023, 2:53 PM
    Thx 🙂
  • p

    pauldwight

    05/04/2023, 1:19 PM
    Regarding the TwillNavigation and setChildren - is it possible for the parent link default to the first child? Reason is that I want to have the following structure: Content - Pages - Articles etc. Ideally something like:
    Copy code
    php
    TwillNavigation::addLink(
        NavigationLink::make()->title('Content')
        ->setChildren([
                NavigationLink::make()->forModule('pages'),
                NavigationLink::make()->forModule('articles')
        ])
    );
    At the moment I need to add forModule('pages') to the Content link which ends up with the following: Content - Content - Articles
  • i

    ifox

    05/04/2023, 2:55 PM
    read your question quickly so it might not be what you're looking for but check the doNotAddSelfAsFirstChild() method
  • p

    pauldwight

    05/04/2023, 3:54 PM
    Thanks - I managed to get it to behave how I want using that. Feels like we should be able to default the main link to the first child if no route/module has been set without specifying the route and then adding it again and ignoring it.
  • j

    jpolito

    05/09/2023, 5:55 PM
    So I know 3.x introduced nested block editors but is it possible to have block editors within repeaters? Works perfectly from the admin side, just not sure how to actually render it. Is something like this possible or am I fundamentally misunderstanding how to implement?
  • j

    jpolito

    05/09/2023, 5:55 PM
    Copy code
    php
    <div>
        @foreach ($block->children as $child)
            <div>
                {!! $child->renderBlocks() !!}
            </div>
        @endforeach
    </div>
  • s

    Smilodown

    05/10/2023, 7:29 AM
    Thanks for your help @kerkness , appreciate it ! Will look at this ! :)😎
  • n

    Navid

    05/12/2023, 4:56 AM
    Hello All, is there any body here to have the problem like my problem .can somebody to help me to resolve it ? Thank you in advance!