Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bigfoot Default Theme Laravel Package

7rin0/bigfoot-default-theme

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer:

    composer require 7rin0/bigfoot-default-theme
    

    Enable the bundle in config/bundles.php:

    return [
        // ...
        SevenRin0\BigfootDefaultTheme\BigfootDefaultThemeBundle::class => ['all' => true],
    ];
    
  2. First Use Case Override the default theme by configuring config/packages/bigfoot_default_theme.yaml:

    bigfoot_default_theme:
        theme: 'default'  # or your custom theme name
    

    Clear cache to apply changes:

    php bin/console cache:clear
    
  3. Where to Look First

    • Bundle Documentation: Check Resources/doc/ for theme structure and Twig templates.
    • Twig Overrides: Locate templates/ in the bundle to understand how to extend or replace templates.
    • Assets: Review Resources/public/ for CSS/JS to customize styling.

Implementation Patterns

Workflow: Extending the Default Theme

  1. Create a Custom Theme Copy the default theme to your project (e.g., templates/bigfoot/):

    mkdir -p templates/bigfoot
    cp -r vendor/7rin0/bigfoot-default-theme/Resources/views/* templates/bigfoot/
    

    Override specific templates (e.g., base.html.twig) in your project’s templates/bigfoot/ directory.

  2. Twig Integration Use Twig’s {% extends %} and {% block %} to modify templates:

    {% extends 'bigfoot/base.html.twig' %}
    {% block title %}Custom Title{% endblock %}
    
  3. Asset Management Override CSS/JS by copying files from vendor/7rin0/bigfoot-default-theme/Resources/public/ to public/build/bigfoot/. Enqueue assets in Twig:

    {{ asset('build/bigfoot/custom.css') }}
    
  4. Configuration Extend the theme config in config/packages/bigfoot_default_theme.yaml:

    bigfoot_default_theme:
        theme: 'custom'  # Your theme name
        assets_path: '%kernel.project_dir%/public/build/bigfoot'
    
  5. Dynamic Theme Switching Use a service or controller to switch themes at runtime:

    // In a controller
    $this->get('bigfoot_default_theme.theme_switcher')->setTheme('custom');
    

Gotchas and Tips

Pitfalls

  1. Cache Dependencies

    • Issue: Changes to Twig templates or assets may not reflect due to Symfony’s cache.
    • Fix: Clear cache aggressively:
      php bin/console cache:clear --env=prod --no-debug
      
    • Tip: Use debug:config to verify theme settings:
      php bin/console debug:config bigfoot_default_theme
      
  2. Asset Paths

    • Issue: Hardcoded asset paths in templates may break in production.
    • Fix: Use Twig’s asset() function or Symfony’s %kernel.project_dir% parameter:
      <link rel="stylesheet" href="{{ asset('build/bigfoot/style.css') }}">
      
  3. Template Inheritance

    • Issue: Overriding templates incorrectly can break layout structure.
    • Fix: Always extend the base template (base.html.twig) and use blocks properly.
  4. Bundle Maturity

    • Issue: Limited documentation or community support (0 stars/dependents).
    • Tip: Inspect the source (SevenRin0/BigfootDefaultThemeBundle) for undocumented features or edge cases.

Debugging

  1. Check Active Theme Dump the active theme in a Twig template:

    {{ dump(app.get('bigfoot_default_theme.theme_switcher').getTheme()) }}
    
  2. Template Debugging Enable Twig’s debug mode in config/packages/twig.yaml:

    twig:
        debug: '%kernel.debug%'
        strict_variables: '%kernel.debug%'
    
  3. Asset Debugging Verify asset paths with:

    php bin/console assets:debug
    

Extension Points

  1. Custom Theme Logic Extend the ThemeSwitcher service by overriding the bundle’s configuration or creating a decorator:

    # config/services.yaml
    services:
        App\Service\CustomThemeSwitcher:
            decorates: 'bigfoot_default_theme.theme_switcher'
            arguments: ['@.inner']
    
  2. Event Listeners Hook into theme events (if the bundle provides them) to add custom logic:

    // src/EventListener/ThemeListener.php
    public function onThemeSwitch(ThemeEvent $event) {
        // Custom logic
    }
    
  3. Twig Extensions Add custom Twig functions/filters for theme-specific logic:

    // src/Twig/AppExtension.php
    class AppExtension extends \Twig\Extension\AbstractExtension {
        public function getFunctions() {
            return [
                new \Twig\TwigFunction('custom_theme_function', [$this, 'customFunction']),
            ];
        }
    }
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui