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
I used to use twill-navigation, but now I'm using the appServiceProvider to declare the routes.
hi @foleystorm you mean buckets, right?
Yes
Hi,Ifox
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')
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.
whats the error?
oh sorry, route names are prefixed by twill now, not admin
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,
],
],
],
],
so
forRoute('twill.featured.posts')
It worked!!! Thank you so much, Ifox!!! I would like to congratulate you for always helping people.