Replies: 2 comments 1 reply
-
Like the docs mention, Runway doesn't support the concept of "localizations" in the same way that entries of taxonomy terms do. This is since we don't want to force developers to add columns to their database tables (not everyone needs stuff attached to sites). It also makes things a lot more complicated behind the scenes. Because of this, I don't really want to introduce the ability to have different routes per-site to Runway, since we don't have any other multi-site functionality. For your use case, it might be better to create custom routes in Route::get('jazz-collection/titles/{slug}', function ($slug) {
$title = \App\Models\Title::firstWhere('slug', $slug);
return $title->toResponse(request());
}); |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response. I understand. If I went with the custom routes solution, would statamic static cacheing still work? I am also looking at overriding the the route function in runway/src/Routing/Traits/RunwayRoutes.php
|
Beta Was this translation helpful? Give feedback.
-
Description
I am attempting to run a multisite, each site using a model Title with differing scopes. But the routes will be different on each site frontend.
Site one: scoped to single project
Site two: scoped to any project
What is the best way of generating and retreiving uris for each site?
Would you accept a PR that included a scope for generating uris?
Something along the lines of
$query->when($query->hasNamedScope('runwayMultisite'), fn ($query) => $query->runwayMultisite());
and adding a column to the runway_uris table like how you suggest in the multisite docs?
Looking at runway/src/Routing/Traits/RunwayRoutes.php
Environment
Environment
Application Name: Statamic
Laravel Version: 11.14.0
PHP Version: 8.2.19
Composer Version: 2.7.6
Environment: local
Debug Mode: ENABLED
URL: local.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: stack / single
Mail: smtp
Queue: database
Session: file
Filament
Packages: filament, forms, notifications, support, tables
Version: v3.2.92
Views: NOT PUBLISHED
Livewire
Livewire: v3.5.1
Spatie Permissions
Features Enabled: Default
Version: 6.9.0
Statamic
Addons: 2
Sites: 3 (site_one, site_two, site_three)
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.12.0 PRO
Statamic Addons
jacksleight/statamic-bard-texstyle: 3.2.2
statamic-rad-pack/runway: 7.5.2
Beta Was this translation helpful? Give feedback.
All reactions