I'm working on a website in pagekit and at the moment I am making an events calendar.
This means that the admin can add events to the website and the visitors can see them in a widget and under the menu item Calendar.
That last one is making me have a headache, how do I add a menu item automaticly like pagekit-blog does?
I found something about nodes in the index.php of the module that should show a option under the add page button in the menu edit screen but it doesn't for me.
What am I missing?
My index.php contains the folowing:
My CalendarSiteController.php contains the folowing:
- namespace SomeClass\SomeExtansion\Controller;
- use Pagekit\Application as App;
- class CalendarSiteController
- * @var Module
- protected $events;
- * Constructor.
- public function __construct()
- $this->events = App::module('events');
- * @Route("/")
- public function indexAction()
- return [
- '$view' => [
- 'title' => __('Calendar'),
- 'name' => 'events/event-list.php',
- 'events' => $this->events
And event-list.php contains:
When I go to the /calendar route on the main site I get the h1 tag containing Hello.
But I can't figure it out how to add the option under add page in the edit menu view off the admin panel.