public function getOptions()
{
- $params = \Route::current()->parameters();
+ $params = \Route::current()?->parameters();
+ if (null === $params) {
+ return [];
+ }
$id = // use the entity name to get the current entry
// this makes sure the ID is corrent even for nested resources
namespace App\Models;
use App\Fields\Webflow\WebflowImages;
-use App\Fields\Webflow\WebflowPage;
use App\Fields\Webflow\WebflowTexts;
use App\Http\Controllers\Admin\Operations\Tools\StaticSiteUploader;
use App\Http\Controllers\Admin\Operations\Tools\WebflowOperation;
use Illuminate\Contracts\Cache\Lock;
use Illuminate\Contracts\Cache\LockTimeoutException;
use Illuminate\Support\Facades\Cache;
-use Illuminate\Support\Facades\Session;
// __('!! Outils')
class ToolWebflow extends ToolboxTranslatableModel
$this->addField('texts', WebflowTexts::class, '', ['tab' => __('Textes'), 'translatable' => true, 'hint' => __('Modifier un texte ici ne produira aucun changement sur webflow')]);
$this->addField('images', WebflowImages::class, '', ['tab' => __('Images'), 'translatable' => true]);
$this->addField('seo', BunchOfFieldsMultiple::class, '', ['translatable' => true, 'edit_label' => '%url | %seo_title', 'allows_add' => false, 'allows_delete' => false, 'allows_clone' => false, 'allows_reorder' => false, 'bunch' => SEOPage::class, 'tab' => __('SEO')]);
- $this->addField('redirections', BunchOfFieldsMultiple::class, '', ['translatable' => false, 'bunch' => Redirection::class, 'tab' => __('Redirections')]);
+ $this->addField('redirections', BunchOfFieldsMultiple::class, '', ['translatable' => false, 'edit_label' => '%from → %to', 'bunch' => Redirection::class, 'tab' => __('Redirections')]);
$this->addField('api', Hidden::class);
}
return $sites['sites'];
}
return [];
- }
+ }
public static function getSiteId($shortname)
{
'og_description_copied' => $details['openGraph']['descriptionCopied'],
];
- $res['seo'][] = $seo;
+ $res['seo'][$pageID] = $seo;
- $texts = [];
foreach ($page['contents'] as $node) {
if ($node['type'] === 'text') {
if (!$node['text']['text']) {
if (isset($res['images'][$assetId])) {
continue;
}
- $res['images'][] = ['id' => $assetId, 'alt' => $node['image']['alt'], 'url' => $data['assets'][$assetId]['hostedUrl']];
+ $res['images'][$assetId] = ['id' => $assetId, 'alt' => $node['image']['alt'], 'url' => $data['assets'][$assetId]['hostedUrl']];
}
}
}