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

    ifox

    05/24/2021, 7:44 PM
    in the frontend or in the CMS preview?
  • i

    ifox

    05/24/2021, 7:47 PM
    in the frontend you are on your own, but the preview by default will expect a view under
    site/moduleName.blade.php
    . You can change it with
    previewView
    in the module controller. so in your case it would be
    protected $previewView = 'article';
  • h

    hazelbag

    05/24/2021, 7:47 PM
    In the frontend
  • i

    ifox

    05/24/2021, 7:48 PM
    well in the frontend you can setup your controller returning the view you'd like
  • i

    ifox

    05/24/2021, 7:49 PM
    and in there you can call
    renderBlocks
    , which will try to find blocks views under
    site.blocks
    , which can be changed by using
    twill.block_editor.block_views_path
  • h

    hazelbag

    05/24/2021, 8:58 PM
    Okay cool, will give it a shot, another question, I might be looking past it, but can I change the title on a migration, to for instance instead of using title it is set to author_title? I change this on the mode under slugAttributes and protected fillable
  • i

    ifox

    05/24/2021, 9:21 PM
    yes you can do exactly like you said and on the controller you'll have to add
    protected $titleColumnKey = 'author_title';
  • k

    Kirk Bushell

    05/24/2021, 11:32 PM
    Yup, and on rathe times we take this a step further, you can even choose the layout you want from the UI for different kinds of articles.
  • k

    Kirk Bushell

    05/24/2021, 11:32 PM
    Ie. feature articles have a more impactful layout/design
  • k

    Kirk Bushell

    05/24/2021, 11:32 PM
    I'm actually going to share how we manage content rendering in the laravel channel later, as I think it's quite clean 🙂
  • r

    Rayderxx

    05/25/2021, 1:00 PM
    Can i use component in a custom block ?
  • i

    ifox

    05/25/2021, 1:01 PM
    @component? or do you mean using twill's internal Vue component in a custom Vue block?
  • r

    Rayderxx

    05/25/2021, 1:01 PM
  • i

    ifox

    05/25/2021, 1:02 PM
    yes that should work
  • r

    Rayderxx

    05/25/2021, 1:03 PM
    ok thx
  • h

    hazelbag

    05/25/2021, 3:22 PM
    Hey again, I now have an error and not sure as to the reason behind this
    Copy code
    Too few arguments to function A17\Twill\Http\Controllers\Front\GlideController::__invoke(), 1 passed in /Users/jacques/workspace/berri-web/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php on line 48 and exactly 2 expected
  • h

    hazelbag

    05/25/2021, 3:22 PM
    Can someone maybe tell me why this would be? I have a bunch of local images in my app that is stored in my public folder
  • i

    ifox

    05/25/2021, 3:23 PM
    hey @hazelbag
  • h

    hazelbag

    05/25/2021, 3:23 PM
    Hey @User 🙂
  • i

    ifox

    05/25/2021, 3:23 PM
    how are you trying to access the glide images and what's your config looking like?
  • i

    ifox

    05/25/2021, 3:24 PM
    when using local uploads and glide, you shouldn't have any custom config to do
  • h

    hazelbag

    05/25/2021, 3:26 PM
    I'm not trying to access them though, that is what I am not certain about with regards to the issue. My S3 bucket is setup in twill.php as
    Copy code
    php
    'media_library' => [
       'driver' => 's3',
       'endpoint_type' => env('MEDIA_LIBRARY_ENDPOINT_TYPE', 's3'),
       'key' => env('S3_KEY', env('AWS_KEY', env('AWS_ACCESS_KEY_ID'))),
       'secret' => env('S3_SECRET', env('AWS_SECRET', env('AWS_SECRET_ACCESS_KEY'))),
       'region' => env('S3_REGION', env('AWS_REGION', env('AWS_DEFAULT_REGION', 'us-east-1'))),
       'bucket' => env('S3_BUCKET', env('AWS_BUCKET')),
       'root' => env('S3_ROOT', env('AWS_ROOT', '')),
       'url' => env('S3_URL', env('AWS_URL', '')),
       'cascade_delete' => env('MEDIA_LIBRARY_CASCADE_DELETE', false),
       'acl' => env('MEDIA_LIBRARY_ACL', 'public-read'),
       'filesize_limit' => env('MEDIA_LIBRARY_FILESIZE_LIMIT', 50),
       'allowed_extensions' => ['jpg', 'gif', 'png', 'jpeg'],
       'init_alt_text_from_filename' => true,
       'prefix_uuid_with_local_path' => config('twill.file_library.prefix_uuid_with_local_path', false),
       'translated_form_fields' => false,
     ],
    
    'glide' => [
       'source' => env('GLIDE_SOURCE',  $filesystem),
       'cache' => env('GLIDE_CACHE', $filesystem),
       'cache_path_prefix' => env('GLIDE_CACHE_PATH_PREFIX', 'glide_cache'),
       'base_url' => env('GLIDE_BASE_URL', 'https://bucketnamehere.s3.amazonaws.com/'),
        'base_path' => env('GLIDE_BASE_PATH', ''),
        'use_signed_urls' => env('GLIDE_USE_SIGNED_URLS', false),
       'sign_key' => env('GLIDE_SIGN_KEY'),
      ],
  • h

    hazelbag

    05/25/2021, 3:26 PM
    This is happening on both local and production
  • h

    hazelbag

    05/25/2021, 3:28 PM
    Oh access the glide images when they are uploaded?
  • h

    hazelbag

    05/25/2021, 3:29 PM
    In my env I have
    MEDIA_LIBRARY_IMAGE_SERVICE=A17\Twill\Services\MediaLibrary\Glide
  • h

    hazelbag

    05/25/2021, 3:42 PM
    @User any idea what I may have missed?
  • i

    ifox

    05/25/2021, 3:57 PM
    ok so you're trying to use Glide with S3. So first thing, you don't need any of the config, you can use environment variables to change the twill defaults instead of overriding all of it. Easier for you to keep up with the framework updates. And then for S3 + Glide specifically let me send you a link
  • i

    ifox

    05/25/2021, 3:58 PM
    https://github.com/area17/twill/pull/730
  • h

    hazelbag

    05/25/2021, 4:10 PM
    Meaning the glide config or both the media_library and glide?
  • h

    hazelbag

    05/25/2021, 4:11 PM
    Copy code
    PHP
    'glide' => [
      'source' => app(A17\Twill\Services\Cloud\Glide::class)->makeCloudSource(
         env('GLIDE_SOURCE', 's3')
      ),
    ],
1...141516...484Latest