Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

How to add a new route with location? #100

Open
niklaswolf opened this issue Oct 29, 2023 · 2 comments
Open

How to add a new route with location? #100

niklaswolf opened this issue Oct 29, 2023 · 2 comments

Comments

@niklaswolf
Copy link

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?

@jleifeld
Copy link
Contributor

jleifeld commented Nov 8, 2023

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

@niklaswolf
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants