Cockpit - the next iteration 🄁

And how would you call a singleton in the new version?

I have tried:

  • $primary_menu = Cockpit::instance()->module(ā€˜Frontpage’)->find(ā€˜primary_menu’);
  • $frontpage = Cockpit::instance()->module(ā€˜Frontpage’);

@tokant If Frontpage it’s the singleton, Have you try this :

$frontpage = Cockpit::instance()->module(ā€˜content’)->find(ā€˜frontpage’, ['filter' => ['_state' => 1]]);
$primary_menu = Cockpit::instance()->module(ā€˜content’)->item('primary_menu');
$frontpage = Cockpit::instance()->module(ā€˜content’)->item('Frontpage');

Is it still possible to get a specific locale?

In previous version, we could add this option [ā€˜lang’ => $locale]

Something like this:
Cockpit::instance()->module(ā€˜content’)->items(ā€˜dictionary’, [ā€˜lang’ => $locale])

Thanks

Yes:

Cockpit::instance()->module(ā€˜content’)->items('dictionary', [], ['locale' => $locale]);

Thanks for the answer and all your work. New version looks really nice.