Skip to content

csaeum/WSCPluginSWDomainSwitcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Installation und Verwendung

Installation:

# 1. Plugin-Ordner erstellen und Dateien hochladen
mkdir -p custom/plugins/WSC_SWDomainSwitcher

# 2. Plugin installieren
php bin/console plugin:refresh
php bin/console plugin:install --activate WSCSWDomainSwitcher
php bin/console cache:clear

Verwendung in Templates:

1. Mit Twig Include:

{# Header Dropdown #}
{% sw_include '@WSCSWDomainSwitcher/storefront/component/domain-switcher.html.twig' %}

{# Footer Flaggen #}
{% sw_include '@WSCSWDomainSwitcher/storefront/component/domain-switcher-inline.html.twig' %}

2. Mit Shortcode-Funktionen:

{# Einfacher Dropdown #}
{{ wsc_domain_switcher() }}

{# Nur Flaggen #}
{{ wsc_domain_flags() }}

{# Custom Dropdown #}
{{ wsc_domain_dropdown({
    'button_text': '🗺️ Sprache wählen',
    'button_class': 'btn btn-primary'
}) }}

{# Custom Flaggen #}
{{ wsc_domain_flags({
    'show_label': false,
    'flag_class': 'btn btn-sm btn-light me-1',
    'container_class': 'd-flex justify-content-center'
}) }}

3. Typische Template-Integrationen:

Header:

{# templates/storefront/layout/header/header.html.twig #}
{% block layout_header_actions %}
    {{ parent() }}
    {{ wsc_domain_switcher() }}
{% endblock %}

Footer:

{# templates/storefront/layout/footer/footer.html.twig #}
{% block layout_footer_inner %}
    {{ wsc_domain_flags({'show_label': false}) }}
    {{ parent() }}
{% endblock %}

Top-Bar:

{# Irgendwo in deinem Layout #}
<div class="top-bar">
    <div class="container d-flex justify-content-between">
        <div>Kostenloser Versand ab 50€</div>
        <div>{{ wsc_domain_flags({'show_label': false}) }}</div>
    </div>
</div>

Debug-URL:

https://deine-domain.com/api/wsc-domain-switch/debug?path=/impressum&domain=andere-domain.com

CSS Styling (Optional):

.wsc-domain-switcher {
    .dropdown-toggle {
        border: 1px solid #dee2e6;
        
        &:hover {
            background-color: #f8f9fa;
        }
    }
    
    .dropdown-menu {
        min-width: 200px;
    }
    
    .wsc-domain-switch-link {
        &:hover {
            background-color: #f8f9fa;
        }
    }
}

.wsc-domain-switcher-inline {
    .wsc-domain-switch-flag {
        width: 40px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2em;
        text-decoration: none;
        
        &:hover {
            background-color: rgba(255, 255, 255, 0.1);
            transform: scale(1.1);
            transition: all 0.2s ease;
        }
    }
}

Features:

Sales Channel basiert - Keine doppelte Datenpflege
SEO-URL Mapping - Automatische URL-Übersetzung
Shortcode-System - Einfache Template-Integration
Debug-Funktion - URL-Mapping testen
Responsive Design - Bootstrap kompatibel
Mehrsprachig - Automatische Sprach-/Ländererkennung

Du musst nur noch:

  1. Die Ordnerstruktur erstellen
  2. Die Dateien hochladen
  3. Plugin installieren
  4. Shortcodes in Templates einbauen

Fertig! 🎯

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published