admin-extension-sdk icon indicating copy to clipboard operation
admin-extension-sdk copied to clipboard

How to add a new route with location?

Open niklaswolf opened this issue 1 year ago • 2 comments

I don't see how I can link to another location from the documentation, only how to update the URL.

My usecase is building a new CRUD interface for a custom entity. I have added successfully a new menu entry which links to a new location. The location renders a new listing of entries using the SwEntityListing component (https://component-library.shopware.com/components/sw-entity-listing). I followed this guide a I don't want/need to build a whole new app (https://shopware.github.io/admin-extension-sdk/docs/guide/getting-started/usage#using-locations-with-normal-vue-components-without-iframe-rendering).

Now I want/need to build the detail page for the entries and link from the listing to the detail page. How do I register another route/page (the detail route) so that I can pass it to the EntityListing component? How do I associate the new route with a location so that I can inject the detail-page component there?

niklaswolf avatar Oct 29 '23 18:10 niklaswolf

Normally routing inside your module have to be done by implementing custom routes inside the iFrame. Without using the iFrame approach you can use the "classic" plugin approach additionally to add a new route which you can use for your links: https://developer.shopware.com/docs/guides/plugins/plugins/administration/add-custom-route.html The route can render your component

jleifeld avatar Nov 08 '23 07:11 jleifeld

Thanks @jleifeld , I'll try it this way :)

niklaswolf avatar Nov 08 '23 10:11 niklaswolf