Hi community!
Is it possible to add a parameter to a menu link item using a CMS Page?
For instance the CMS page defined a param like account/{{page}}
and in the user menu defined with RainLab.Pages, I’d like to add menu items linked to this CMS page and specify the param page
. How is that possible?
I extended the plugin but would like to show this extra dropdown only for a particular CMS page, is this possible?
public function extendRainLabPages(): void
{
Event::listen('backend.form.extendFields', function ($widget) {
if (
!$widget->getController() instanceof \RainLab\Pages\Controllers\Index ||
!$widget->model instanceof \RainLab\Pages\Classes\MenuItem
) {
return;
}
$widget->addTabFields([
'viewBag[account_page]' => [
'tab' => 'Account Pages',
'label' => 'Account Pages',
'commentAbove' => 'Select the account pages to link the menu to. (Only for the User Menu)',
'type' => 'dropdown',
'options' => [
'dashboard' => "Dashboard",
'profile' => 'Profile',
'company' => 'Company',
'contacts' => 'Contacts',
]
]
]);
});
}