How to add link to custom module configuration form in Drupal 8

by emersonthis   Last Updated November 12, 2017 03:07 AM

I'm working on a custom module that has a couple configuration form for controlling it's settings. I want to add a link to this form to the admin configuration UI. The new link to my settings isn't appearing, but the form works fine if I navigate directly to it using the URL.


  title: 'Stripe Donation'
  description: 'Manage settings for strip donations'
  parent: system.admin_config_system
  # menu_name: main
  route_name: stripedonation.settings
  weight: 1

NOTE: I cleared the cache after adding this.

# stripedonation.routing.yml

  path: '/admin/config/stripedonation'
    _form: '\Drupal\stripedonation\Form\SettingsForm'
    _title: 'Stipe Donation Settings'
    _permission: 'administer site config'

I also tried adding the key shown below to my *.info.yml file and it didn't help


name: "Stripe Donation"
type: module
description: "Adds Stripe Donation form for ThinkShout vetting exercrise"
package: EmersonThis
core: 8.x
# configure: stripedonation.settings

In case it matters...

# stripedonation.settings.yml
stripe_pub_key: ''
stripe_secret_key: ''

I'm expecting my menu link to show up here (but obviously it is not): enter image description here

I've studied the following documentation:

I've also studied every "how-to" I could find:

Still no menu in the admin UI. What am I doing wrong?

Tags : 8 forms navigation

Answers 1

Well it turned out to be a stupid mistake!

All of my filenames and syntax were correct, but my * accidentally was saved into the src/ directory of my module instead of at the root of it. I moved it where it should be and cleared the cache and it works fine.

November 12, 2017 02:30 AM

Related Questions

How can I add an option to a menu

Updated November 08, 2018 17:07 PM

Drupal 8 tabindex -1 on admin form elements

Updated November 08, 2018 23:07 PM

How to render a link as a button

Updated May 17, 2018 17:07 PM