Module Registration¶
The registerEntityModule function registers a complete Shopware Administration module with routing, navigation, and settings integration.
Basic Usage¶
import {
registerEntityModule,
registerDetailComponent,
registerListingComponent
} from '@friendsofshopware/jetpack';
registerEntityModule({
entity: 'store',
listingComponent: registerListingComponent({ /* ... */ }),
detailComponent: registerDetailComponent({ /* ... */ })
});
Options¶
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
entity |
string |
Yes | - | The entity name (e.g., store, my_custom_entity) |
listingComponent |
string |
Yes | - | Component name returned by registerListingComponent |
detailComponent |
string |
Yes | - | Component name returned by registerDetailComponent |
color |
string |
No | #9AA8B5 |
Module color in hex format |
icon |
string |
No | regular-envelope |
Icon name from Shopware Icon Set |
showInNavigation |
boolean |
No | true |
Show module in main navigation |
showInSettings |
boolean |
No | false |
Show module in settings |
navigationParentModule |
string |
No | sw-customer |
Parent module for navigation placement |
parentPath |
string |
No | sw.settings.index.plugins |
Parent path for settings placement |
Generated Routes¶
FroshJetpack automatically generates three routes for your module. You can use these route names to link to your module from other parts of the administration (e.g., in <sw-button :to="{ name: 'jetpack.store.list' }">).
| Route | Path | Description |
|---|---|---|
jetpack.{entity}.list |
/list |
Listing page |
jetpack.{entity}.create |
/create |
Create new entity |
jetpack.{entity}.detail |
/detail/:id |
Edit existing entity |
For an entity named store, the routes would be:
jetpack.store.listjetpack.store.createjetpack.store.detail
Navigation Placement¶
Main Navigation¶
To show your module in the main navigation under a specific parent:
registerEntityModule({
entity: 'store',
showInNavigation: true,
navigationParentModule: 'sw-catalogue', // Parent module
// ...
});
Common parent modules:
sw-catalogue- Under Cataloguessw-customer- Under Customerssw-content- Under Contentsw-marketing- Under Marketingsw-order- Under Orders
Settings¶
To show your module in the settings area:
registerEntityModule({
entity: 'store',
showInSettings: true,
showInNavigation: false, // Usually disable main nav when in settings
parentPath: 'sw.settings.index.plugins', // Settings group
// ...
});
ACL Privileges¶
FroshJetpack uses standard Shopware entity privileges:
| Privilege | Used for |
|---|---|
{entity}:read |
Viewing list and detail |
{entity}:create |
Creating new entities |
{entity}:update |
Updating entities |
{entity}:delete |
Deleting entities |
For an entity named store:
store:readstore:createstore:updatestore:delete
Example: Full Configuration¶
registerEntityModule({
entity: 'store',
color: '#ff6b6b',
icon: 'regular-store',
showInNavigation: true,
showInSettings: true,
navigationParentModule: 'sw-catalogue',
parentPath: 'sw.settings.index.plugins',
listingComponent: registerListingComponent({
entity: 'store',
columns: {
name: { linkToDetail: true }
}
}),
detailComponent: registerDetailComponent({
entity: 'store',
cards: [{
name: 'general',
fields: {
name: { type: 'text' }
}
}]
})
});