cancel
Showing results for 
Search instead for 
Did you mean: 

How to get key value in magento url

SOLVED

How to get key value in magento url

How to get the key value in magento

 

/admin_eol0g7/admin/import/index/key/d60a648147e65302958c4cb9e8e067be0e1a72522e6f4c82b7b937497d3898a0/

 

when i open my module in magento i get a url, do this url always changes , is key changes for every user . I want to navigate user to a module page on button click . can i dynamically generate the url of magento module page from any other module.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to get key value in magento url

Hello @Sahil_coder ,

 

If you remove key from URL, It will be easy for you. You can find configuration below

  • On the Admin sidebar, click Stores > Settings > Configuration.
  • In the panel on the left, choose Advanced > Admin > Security.

In the Add Secret Key to URLs field, leave “Yes” as in default to enable a secret key to Admin URLs or choose “No” to disable it https://www.screencast.com/t/kCRt9ijCm1D

tkkAYVj.png

 


--
If my answer is useful, please Accept as Solution & give Kudos

 

 

View solution in original post

5 REPLIES 5

Re: How to get key value in magento url

The key value for each user vary for every time you can log in with Magento admin panel.

You dont need to worry about create your dynamic URL for your admin. They will be auto generate every time and you can use your custom dynamic URL in admin panel.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: How to get key value in magento url

xyz.com/admin_eol0g7/mediauploader/allmedia/index/key/98559cdd3acf691676ff7ad2c2f490bb7df49d6c074a7abb6a2336ddd6b1d75f/

 

I have that (https://xyz.com/admin_eol0g7/mediauploader/allmedia/index) part of my url always fixed if i put that in my custom button will it work , will it navigate to above url or i have to append key in that . If yes where i can get the value of key in module.

Re: How to get key value in magento url

You need to use below way to create custom URL,

 

$this->getUrl('mediauploader/allmedia/index')

Using above way its working fine.

 

 

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: How to get key value in magento url

Hello @Sahil_coder ,

 

If you remove key from URL, It will be easy for you. You can find configuration below

  • On the Admin sidebar, click Stores > Settings > Configuration.
  • In the panel on the left, choose Advanced > Admin > Security.

In the Add Secret Key to URLs field, leave “Yes” as in default to enable a secret key to Admin URLs or choose “No” to disable it https://www.screencast.com/t/kCRt9ijCm1D

tkkAYVj.png

 


--
If my answer is useful, please Accept as Solution & give Kudos

 

 

Re: How to get key value in magento url