# Shopware Plugin Navigation

**Navigation** features connect Shopware references to definitions, templates, icons, DAL entities, system config, administration components, and app-script resources.

---

## Navigate from Shopware Twig template references

**Feature ID:** `PlatformTwigGotoHandler`  
**Feature Page:** [Navigate from Shopware Twig template references](https://espend.de/phpstorm/plugin/shopware#platform-twig-goto-handler)  

Navigates from Shopware storefront Twig references, icon names, and thumbnail names to the resolved target, with template usage support for Shopware inheritance tags.

### Code Examples

```twig
# Storefront Twig reference:
{% sw_extends '@Storefront/storefront/page/product-detail/index.html.twig' %}
{% sw_include '@Storefront/storefront/component/product/card/box.html.twig' %}
{% sw_embed '@Storefront/storefront/component/product/card/action.html.twig' %}{% end_sw_embed %}
{% sw_icon 'shopping-bag' style { 'pack': 'solid' } %}
{% sw_thumbnails 'product-image-thumbnails' with {
    media: product.cover.media
} %}
```

---

## Navigate from sw_icon names to SVG files

**Feature ID:** `PlatformSwIconGotoHandler`  
**Feature Page:** [Navigate from sw_icon names to SVG files](https://espend.de/phpstorm/plugin/shopware#platform-sw-icon-goto-handler)  

Navigates from literal `sw_icon` calls to the SVG file in the selected icon pack.

### Code Examples

```twig
# Icon reference:
{% sw_icon 'shopping-bag' style { 'pack': 'solid' } %}
```

---

## Navigate from sw_thumbnails names

**Feature ID:** `PlatformSwThumbnailGotoHandler`  
**Feature Page:** [Navigate from sw_thumbnails names](https://espend.de/phpstorm/plugin/shopware#platform-sw-thumbnail-goto-handler)  

Navigates between literal `sw_thumbnails` names and the indexed Twig usages that define the same thumbnail key.

### Code Examples

```twig
# Thumbnail reference:
{% sw_thumbnails 'product-image-thumbnails' with {
    media: product.cover.media
} %}
```

---

## Navigate from Administration components and slots

**Feature ID:** `PlatformAdminComponentGotoHandler`  
**Feature Page:** [Navigate from Administration components and slots](https://espend.de/phpstorm/plugin/shopware#platform-admin-component-goto-handler)  

Navigates from Administration component names and slot usages to useful targets, including lazy definition files, registry key literals, resolved templates, and slot definitions.

### Code Examples

```javascript
# Component registry and definition targets:
Shopware.Component.register('sw-page', () => import('src/app/component/structure/sw-page/index'));

Shopware.Component.override('sw-product-detail', {
    template,
});
```

```html
# Slot usage:
<sw-page>
    <template #smart-bar-actions>
        <sw-button variant="primary">Save</sw-button>
    </template>
</sw-page>
```

---

## Navigate from Administration mixins

**Feature ID:** `PlatformAdminMixinGotoHandler`  
**Feature Page:** [Navigate from Administration mixins](https://espend.de/phpstorm/plugin/shopware#platform-admin-mixin-goto-handler)  

Navigates from mixin lookups to the matching Administration mixin registration.

### Code Examples

```javascript
# Mixin lookup:
const notification = Shopware.Mixin.getByName('notification');
```

---

## Navigate from Administration module routes

**Feature ID:** `PlatformAdminModuleRouteGotoHandler`  
**Feature Page:** [Navigate from Administration module routes](https://espend.de/phpstorm/plugin/shopware#platform-admin-module-route-goto-handler)  

Navigates from Administration route names to the module route definition that registered them.

### Code Examples

```javascript
# Module route reference:
this.$router.push({ name: 'sw.product.detail', params: { id } });
```

```javascript
# Route definition:
Shopware.Module.register('swag-example', {
    routes: {
        detail: {
            component: 'swag-example-detail',
            path: 'detail/:id',
        },
    },
});
```

---

## Navigate from system config keys to config XML

**Feature ID:** `PlatformSystemConfigGotoHandler`  
**Feature Page:** [Navigate from system config keys to config XML](https://espend.de/phpstorm/plugin/shopware#platform-system-config-goto-handler)  

Navigates from PHP system config read/write usages and Twig `config()` calls to the matching plugin or app configuration field.

### Code Examples

```php
# Config key usage:
$label = $this->systemConfigService->get('SwagExample.config.buttonLabel');
$this->systemConfigService->set('SwagExample.config.buttonLabel', 'Buy now');
```

```twig
# Twig config usage:
{{ config('SwagExample.config.buttonLabel') }}
```

---

## Navigate from DAL fields to entity definitions

**Feature ID:** `PlatformDalGotoHandler`  
**Feature Page:** [Navigate from DAL fields to entity definitions](https://espend.de/phpstorm/plugin/shopware#platform-dal-goto-handler)  

Navigates from DAL field and association path usages to entity definitions and field declarations.

### Code Examples

```php
# DAL path:
$criteria->addFilter(new EqualsFilter('manufacturer.name', $name));
```

---

## Navigate from app-script facade arguments

**Feature ID:** `ShopwareAppTwigGotoHandler`  
**Feature Page:** [Navigate from app-script facade arguments](https://espend.de/phpstorm/plugin/shopware#shopware-app-twig-goto-handler)  

Navigates from type-resolved app-script facade string arguments to platform entities, app custom entities, and system config XML entries.

### Code Examples

```twig
# Entity and config references:
{% set products = services.repository.search('product', criteria) %}
{% set total = services.repository.aggregate('product', criteria) %}
{% set result = services.writer.upsert('custom_entity_blog', payload) %}
{% set threshold = services.config.app('freeShippingThreshold') %}
{% set full = services.config.get('AgencyWorkflowApp.config.freeShippingThreshold') %}
```

---

## Navigate from translation keys to snippets

**Feature ID:** `TranslationReferenceNavigation`  
**Feature Page:** [Navigate from translation keys to snippets](https://espend.de/phpstorm/plugin/shopware#translation-reference-navigation)  

Navigates from PHP and Administration JavaScript translation keys to the matching snippet entry.

### Code Examples

```php
# Translation key references:
$this->trans('checkout.cart.title');
```

---

