featured

Good evening. I would like some help. I've upgraded to version 3 of Twill, and the "featured" functionality has stopped working. How can I configure it in this new version?
11 Replies
foleystorm
foleystormOP2y ago
I used to use twill-navigation, but now I'm using the appServiceProvider to declare the routes.
ifox
ifox2y ago
hi @foleystorm you mean buckets, right?
foleystorm
foleystormOP2y ago
Yes Hi,Ifox
ifox
ifox2y ago
did you try adding a NavigationLink that points to a route, like it was defined in the twill-navigation before? NavigationLink::make()->forRoute('admin.featured.bucket-key')
foleystorm
foleystormOP2y ago
I tried that: TwillNavigation::addLink( NavigationLink::make() ->forRoute('admin.featured.videos') ->setChildren([ NavigationLink::make() ->forRoute('admin.featured.videos') ->title('Vídeos'), NavigationLink::make() ->forRoute('admin.featured.posts') ->title('Notícias'), ]) ->doNotAddSelfAsFirstChild() ->title('Destaques') ); but it didn't work.
ifox
ifox2y ago
whats the error?
foleystorm
foleystormOP2y ago
No description
ifox
ifox2y ago
oh sorry, route names are prefixed by twill now, not admin
foleystorm
foleystormOP2y ago
Twill.php: 'enabled' => [ 'buckets' => true, ], 'buckets' => [ 'videos' => [ 'name' => 'Home', 'buckets' => [ 'videos_feature' => [ 'name' => 'Em destaque', 'bucketables' => [ [ 'module' => 'videos', 'name' => 'videos', 'repository' => 'App\Repositories\VideoRepository', 'scopes' => ['published' => true], ], ], 'max_items' => 3, ], ], ], 'posts' => [ 'name' => 'Home', 'buckets' => [ 'posts_feature' => [ 'name' => 'Em destaque', 'bucketables' => [ [ 'module' => 'posts', 'name' => 'posts', 'repository' => 'App\Twill\Capsules\Posts\Repositories\PostRepository', 'scopes' => ['published' => true, 'orderByPublishedDate' => true], ], ], 'max_items' => 3, ], ], ], ],
ifox
ifox2y ago
so forRoute('twill.featured.posts')
foleystorm
foleystormOP2y ago
It worked!!! Thank you so much, Ifox!!! I would like to congratulate you for always helping people.
Want results from more Discord servers?
Add your server