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

    Yasien

    10/21/2022, 1:56 PM
    Hello, As far as I know, to enable preview of a Twill module, I need to add HasRevisions and HandleRevisions. is there's any other thing needed? I have done so but cannot see the preview or revisions yet Twill version 2.5.3 I have also set previewView on controller but not showing too Thank you
  • i

    ifox

    10/21/2022, 1:59 PM
    Hi @Yasien that's correct as far as traits. Try saving your record once after adding the traits to see the features in the ui. Are you getting an error when opening the preview?
  • y

    Yasien

    10/21/2022, 2:01 PM
    No I don't see the UI for previewing it in the CMS, just update button and languages selector
  • y

    Yasien

    10/21/2022, 2:02 PM
    It showed after doing an update. Thank you
  • y

    Yasien

    10/21/2022, 2:02 PM
    Thanks @ifox
  • e

    elkex

    10/24/2022, 12:31 PM
    I do not immediately seem to find the solution, but is it possible to add repeater blocks to the block library?
  • i

    ifox

    10/24/2022, 12:32 PM
    Hi @elkex you can use a repeater inside a block, but not a repeater "as" a block
  • e

    elkex

    10/24/2022, 12:36 PM
    So a block with a repeater in it and a browser is possible?
  • i

    ifox

    10/24/2022, 12:37 PM
    yes
  • e

    elkex

    10/24/2022, 12:37 PM
    Nice, I want it, haha
  • e

    elkex

    10/24/2022, 12:39 PM
    How can i access data from other models (with their translations) from other controllers than those connected to the repo?
  • i

    ifox

    10/24/2022, 12:40 PM
    you can access any repo/model from any controller.
    $anotherRepo = app(SomeRepository::class)
  • e

    elkex

    10/24/2022, 12:44 PM
    Easy like Sunday morning.. Thanks!
  • t

    tud13

    10/24/2022, 4:49 PM
    Finally found the time to make the PR: https://github.com/area17/twill/pull/1869 May this be the first of many contributions to come 🙂
  • d

    dakaalim

    10/24/2022, 8:44 PM
    If you create a module with a name then ends with
    tion
    , a
    table not found
    error will occur. e.g.
    php artisan twill:capsule:make --singleton PickupInformation
    The code reads
    pickup_information
    when it should be reading table
    pickup_informations
  • i

    ifox

    10/24/2022, 9:08 PM
    Hi @dakaalim I'm not sure it's
    tion
    . it's more that
    informations
    doesn't exist in english. Information is an uncountable noun.
  • d

    dakaalim

    10/24/2022, 9:59 PM
    @ifox I generated the module using the name
    PickupInformation
    , but then the seeder failed to seed, it said table
    pickup_informations
    not found when I use
    PickupInformations
    , it said table
    pickup_information
    not found I'm not sure why, I have settled with the name
    PickupInfo
    , no issue with this name, so my guess is it's got something to do with
    tion
  • i

    ifox

    10/24/2022, 10:02 PM
    Copy code
    php
    >>> Str::plural('PickupInformation')
    => "PickupInformations"
    
    >>> Str::plural('Information')
    => "Information"
    
    >>> Str::plural('PickupInfo')
    => "PickupInfos"
    
    >>> Str::plural('Info')
    => "Infos"
  • i

    ifox

    10/24/2022, 10:04 PM
    see how info is getting a
    s
    in both cases, but information doesn't
  • i

    ifox

    10/24/2022, 10:05 PM
    a "regular" word ending in
    tion
    that doesn't have the issue:
  • i

    ifox

    10/24/2022, 10:05 PM
    Copy code
    php
    >>> Str::plural('PickupGeneration')
    => "PickupGenerations"
    
    >>> Str::plural('Generation')
    => "Generations"
  • d

    dakaalim

    10/24/2022, 10:46 PM
    I see
  • s

    savchuk.ivan

    10/25/2022, 1:07 PM
    @Harings Rob Good evening, tell me if it is possible to add options for blocks? I want to get rid of the creation of extra blocks.
  • h

    Harings Rob

    10/25/2022, 1:07 PM
    hey @savchuk.ivan I do not really understand the question.
  • h

    Harings Rob

    10/25/2022, 1:07 PM
    Options to be passed in from the blockeditor field?
  • s

    savchuk.ivan

    10/25/2022, 1:11 PM
    @Harings Rob My issue is similar to this one https://github.com/area17/twill/issues/1688?. It's already been implemented, can you tell me?
  • h

    Harings Rob

    10/25/2022, 1:12 PM
    Ah, not this is not yet implemented. That will be for after the 3.x release.
  • s

    savchuk.ivan

    10/25/2022, 1:13 PM
    @Harings Rob Very sorry. The idea is very good)
  • s

    savchuk.ivan

    10/25/2022, 2:30 PM
    @Harings Rob I found a solution to my question I asked earlier. ) 1) I moved @formField to a separate file. 2) Added it to the main block file via include
    @include('admin.part.wysiwyg', [$name_block = 'title_block', $label = 'Title'])
    3) And in the file in which I took out @formField I did this
    Copy code
    $label = $label ?? 'Name';
    $name = $name_block ?? 'title';
    ?>
    
    @formField('wysiwyg', [
    'name' => "${name}",
    'label' => "${label}",
  • h

    Harings Rob

    10/25/2022, 2:31 PM
    But, that does not let you pass in a property from the block editor field.
1...419420421...484Latest