Skip to content

Console Commands

Contents of this page:

The Guppy Theme provides specialized console commands that simplify the development process and automate project setup.

Available Commands

guppy:theme:create

Automatically creates a new child theme based on the Guppy Theme.

Usage

bash
bin/console guppy:theme:create

Interactive Configuration

The command guides you through an interactive process:

Basic Settings
  • Namespace: Default namespace for the theme (e.g., "Dmf")
  • Theme Name: Name of the child theme (e.g., "CustomerShop")
  • Theme Title: Display name in admin panel
Color Configuration
  • Primary Color: Main theme color (default: #215AFF)
  • Secondary Color: Supporting color (default: #0B1845)
  • Border Color: Color for borders (default: #CFD1D7)
  • Background Color: Base background color (default: #FFFFFF)
Asset Configuration
  • Plugin Image: Name for plugin icon (plugin.png)
  • Preview Image: Name for theme preview (preview.jpg)
  • Logo: Name for main logo (logo.svg)
  • Share Icon: Name for social media icon (share-icon.svg)
  • Favicon: Name for favicon (favicon.ico)

Automatic Creation

The command automatically creates:

Directory Structure
custom/static-plugins/DmfCustomerShopTheme/
├── src/
│   ├── DmfCustomerShopTheme.php
│   └── Resources/
│       ├── app/storefront/
│       │   ├── src/scss/
│       │   │   ├── base.scss
│       │   │   └── overrides.scss
│       │   └── dist/
│       │       ├── assets/
│       │       └── storefront/js/
│       ├── config/
│       │   └── plugin.png
│       └── views/storefront/
└── composer.json
Automatic Configuration
  • composer.json: Complete Composer configuration
  • theme.json: Fully configured theme file with inheritance
  • PHP Class: Theme class with correct namespace
Config Inheritance
json
{
  "configInheritance": [
    "@Storefront",
    "@DmfGuppyTheme"
  ]
}

Additional Features

Composer Integration
  • Automatic Installation: Optional via Composer
  • Dependency Management: Automatic Guppy Theme dependency
  • Semantic Versioning: Versioning from 0.1.0
Asset Management
  • Automatic Copying: Standard assets are copied
  • Path Generation: Automatic asset paths
  • File Validation: Check for existing assets

Example Output

bash
$ bin/console guppy:theme:create

 Theme Create Command
 ====================

 Please enter the namespace of the theme. [Dmf]:
 > Dmf

 Please enter the name of the theme (e.g., Child).
 > MyShop

 Please enter the title of the theme as it should be displayed in admin.
 > My Custom Shop Theme

 Do you want to configure the theme? (yes/no) [yes]:
 > yes

 [OK] The theme was successfully created at: /path/to/custom/static-plugins/DmfMyShopTheme

guppy:install:plugins

Automatically installs the recommended plugins for the Guppy Theme.

Usage

bash
bin/console guppy:install:plugins

Available Plugins

1. DmfCustomFonts
  • Description: Enables custom fonts
  • Composer Package: dmf/sw6-plugin-custom-fonts
  • Usage: Integration of custom web fonts
2. DmfCustomGrid
  • Description: Extended grid layouts for CMS
  • Composer Package: dmf/sw6-plugin-cms-custom-grids
  • Usage: 11 additional grid variants
3. GuppyEmotionworldElements
  • Description: Specialized CMS elements
  • Composer Package: dmf/sw6-plugin-guppy-emotionworld-elements
  • Usage: Extended CMS functions

Interactive Installation

The command asks for each plugin individually:

bash
$ bin/console guppy:install:plugins

 Install Plugins
 ===============

 Do you want to install the plugin Dmf Custom Fonts? (yes/no) [no]:
 > yes

 [OK] The plugin Dmf Custom Fonts was successfully installed.

 Do you want to install the plugin Dmf Custom Grid? (yes/no) [no]:
 > yes

 [OK] The plugin Dmf Custom Grid was successfully installed.

Error Handling

  • Automatic Error Checking: Composer return code verification
  • Detailed Error Messages: Specific error messages per plugin
  • Continue on Errors: One failed plugin doesn't break the process

Best Practices

Theme Development

  1. Use meaningful namespaces

    bash
    # Good
    Namespace: MyCompany
    Theme Name: CustomerPortal
    
    # Bad
    Namespace: Test
    Theme Name: Theme1
  2. Prepare assets in advance

    • Provide all required assets
    • Use consistent naming conventions
    • Optimize images for web use
  3. Use Config Inheritance

    json
    {
      "configInheritance": [
        "@Storefront",
        "@DmfGuppyTheme"
      ]
    }

Plugin Installation

  1. Install all recommended plugins

    • Use the full functionality
    • Test compatibility before production environment
  2. Follow installation order

    bash
    # 1. Install plugins
    bin/console guppy:install:plugins
    
    # 2. Clear plugin cache
    bin/console plugin:refresh
    
    # 3. Activate theme
    bin/console theme:change

Troubleshooting

Common Issues

Theme creation fails

  • Problem: Directory already exists
  • Solution: Delete existing directory or choose different name

Plugin installation fails

  • Problem: Composer error
  • Solution: Check Composer configuration and network connection

Assets not found

  • Problem: Default assets missing
  • Solution: Check /src/Resources/default-assets/ directory

Debugging

Enable verbose mode

bash
bin/console guppy:theme:create -v
bin/console guppy:install:plugins -v

Check log files

bash
# Shopware logs
tail -f var/log/prod.log

# Composer logs
composer install --verbose