Discussion:
menu_links.yml and routing.yml
(too old to reply)
Muzaffer Tolga Ozses
2014-04-03 08:17:12 UTC
Permalink
Hi

I have been porting my contrib to Drupal 8 for a while, and with the latest
change about hook_menu_links_default being removed and menu_links.yml being
added, I am stuck. Even though I have been examining core modules' code.
Long story short, my link doesn't show up on /admin/config/system. Can you
help me? Below are my files.

tcmb.menu_links.yml
---
tcmb.tcmb_settings:
title: Tcmb General Settings
description: 'Configure Tcmb module.'
route_name: tcmb.tcmb_settings
parent: system.admin_config_system
weight: 1
tcmb.tcmb_settings_currency:
title: 'Tcmb General Settings'
description: 'Configure Tcmb module.'
route_name: tcmb.tcmb_settings
parent: system_admin_config_system
weight: 1
tcmb.gold_settings
title: 'Gold settings'
description: 'Configure Tcmb gold settings.'
route_name: tcmb.gold_settings
parent: tcmb.admin_config_system_tcmb_settings
weight: 2
tcmb.other_settings:
title: 'Other settings'
description: 'Configure other settings.'
route_name: tcmb.other_settings
parent: tcmb.admin_config_system_tcmb_settings
weight: 3
tcmb.other_settings_currency:
title: 'Currency Settings'
description: 'Configure other settings.'
route_name: tcmb.other_settings_currency
parent: tcmb.tcmb_other_settings
weight: 1
tcmb.other_settings_gold:
title: Gold Settings
description: 'Gold Settings'
route_name: tcmb.other_settings_gold
parent: tcmb.tcmb_other_settings
weight: 2

tcmb.routing.yml
---
tcmb.tcmb_settings:
path: '/admin/config/system/tcmb-settings'
defaults:
_form: 'Drupal\tcmb\TcmbCurrencySettingsForm'
_title: 'Tcmb General Settings'
requirements:
_permission: 'administer Tcmb'
tcmb.gold_settings:
path: '/admin/config/system/tcmb-settings/gold-settings'
defaults:
_form: 'Drupal\tcmb\TcmbGoldSettingsForm'
requirements:
_permission: 'administer Tcmb'
tcmb.other_settings:
path: '/admin/config/system/tcmb-settings/other-settings'
defaults:
_form: 'Drupal\tcmb\TcmbOtherSettingsForm'
requirements:
_permission: 'administer Tcmb'
tcmb.other_settings_currency:
path: '/admin/config/system/tcmb-settings/other-settings/currency'
defaults:
_form: 'Drupal\tcmb\TcmbOtherSettingsForm'
requirements:
_permission: 'administer Tcmb'
tcmb.other_settings_gold:
path: '/admin/config/system/tcmb-settings/other-settings/gold'
defaults:
_form: 'Drupal\tcmb\TcmbOtherGoldSettingsForm'
requirements:
_permission: 'administer Tcmb'

Regards,
mto

Loading...