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

Cms Frontend Laravel Package

typo3/cms-frontend

TYPO3 CMS frontend package providing core rendering and page output features: TypoScript processing, content element rendering, menus, link generation, caching integration, and frontend controller utilities used to build and serve TYPO3 websites.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup for Laravel Integration

To leverage typo3/cms-frontend in a Laravel project (note: this is a CMS frontend, not a Laravel package—integration requires custom bridging), follow these steps:

  1. Install TYPO3 CMS

    • Deploy TYPO3 CMS (v11+) via Docker, Composer, or traditional install.
    • Configure a shared storage directory (e.g., public/uploads) for media assets.
  2. Laravel-TYPO3 Bridge

    • Use a middleware to proxy requests to TYPO3’s frontend:
      // app/Http/Middleware/ProxyToTypo3.php
      public function handle($request, Closure $next) {
          $typo3Url = config('typo3.frontend_url');
          return redirect()->away($typo3Url . $request->path());
      }
      
    • Register in app/Http/Kernel.php:
      protected $middlewareGroups = [
          'web' => [
              // ...
              \App\Http\Middleware\ProxyToTypo3::class,
          ],
      ];
      
  3. First Use Case: Embed TYPO3 Pages

    • Use TYPO3’s REST API (via EXT:news or EXT:frontend) to fetch page content:
      // Fetch a TYPO3 page via API
      $response = Http::get(config('typo3.api_url') . '/pages/123');
      return view('typo3.embedded', ['content' => $response->json()]);
      

Implementation Patterns

Workflow: Hybrid Laravel-TYPO3 Frontend

  1. Static Content in Laravel

    • Use Laravel Blade for dynamic sections (e.g., user dashboards).
    • Embed TYPO3-rendered content via iframes or API calls:
      @if(auth()->check())
          <!-- Laravel dynamic content -->
      @else
          <iframe src="{{ config('typo3.frontend_url') }}/homepage"></iframe>
      @endif
      
  2. API-Driven Integration

    • Poll TYPO3’s JSON API for structured data (e.g., news, products):
      // Fetch TYPO3 news via API
      $news = Http::get(config('typo3.api_url') . '/news')->json();
      return view('blog.index', compact('news'));
      
  3. Shared Authentication

    • Sync Laravel users with TYPO3’s BE/FE users via:
      • Database sharing: Use a single fe_users table.
      • OAuth2: Implement a custom provider (e.g., league/oauth2-server).
  4. Asset Management

    • Mount TYPO3’s fileadmin/ as a Laravel storage symlink:
      ln -s /path/to/typo3/fileadmin public/typo3-assets
      
    • Configure Laravel’s filesystem.php:
      'disks' => [
          'typo3_assets' => [
              'driver' => 'local',
              'root' => public_path('typo3-assets'),
          ],
      ],
      
  5. Routing Overrides

    • Use Laravel’s routing to handle TYPO3’s .html URLs:
      Route::get('/{page}.html', function ($page) {
          return redirect()->away(config('typo3.frontend_url') . "/$page.html");
      });
      

Gotchas and Tips

Pitfalls

  1. Caching Conflicts

    • TYPO3 caches pages aggressively. Bypass with:
      • Query params: /page.html?nocache=1.
      • Laravel’s Cache::forget() for API responses.
  2. CSRF Token Mismatches

    • TYPO3’s FE uses its own tokens. For forms spanning both systems:
      • Disable CSRF in Laravel for TYPO3-proxied forms:
        // app/Http/Middleware/VerifyCsrfToken.php
        protected $except = [
            'typo3/*',
        ];
        
  3. Session Inconsistencies

    • TYPO3 and Laravel use separate sessions by default. Merge them:
      // In a middleware
      session(['typo3' => $_SESSION['fe_typo_user']]);
      
  4. URL Generation Issues

    • TYPO3’s typolink generates URLs like /?id=123. Use Laravel’s Url::to() for consistency:
      // Convert TYPO3 ID to Laravel route
      $url = route('typo3.page', ['id' => 123]);
      

Debugging Tips

  • TYPO3 Logs: Check /typo3conf/log/ for errors.
  • Laravel-TYPO3 Sync: Use dd($_SESSION) to compare sessions.
  • API Testing: Validate TYPO3’s JSON API with Postman:
    GET /typo3/api/news?format=json
    

Extension Points

  1. Custom TYPO3 Extensions

    • Develop TYPO3 extensions (e.g., EXT:laravel_bridge) to expose Laravel data to TYPO3’s FE.
  2. Webhook Integration

    • Trigger Laravel jobs on TYPO3 events (e.g., new content):
      // TYPO3 Extension Hook
      $client = new \GuzzleHttp\Client();
      $client->post('http://laravel-app/webhooks/typo3', [
          'json' => ['event' => 'page_created', 'data' => $row]
      ]);
      
  3. Laravel Service Providers

    • Register TYPO3 clients in Laravel:
      // app/Providers/Typo3ServiceProvider.php
      public function register() {
          $this->app->singleton(Typo3Client::class, function () {
              return new Typo3Client(config('typo3.api_url'));
          });
      }
      
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor