Skip to content

Commit

Permalink
Always show Custom image option (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseleite authored May 10, 2024
1 parent 8960f82 commit 6a12760
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/HasAssetField.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait HasAssetField
protected static function getAssetFieldConfig()
{
if (! $container = config('statamic.seo-pro.assets.container')) {
return false;
return static::getAssetFieldContainerError();
}

return [
Expand All @@ -21,4 +21,24 @@ protected static function getAssetFieldConfig()
'max_files' => 1,
];
}

/**
* Show helpful asset field config error.
*
* @return array
*/
protected static function getAssetFieldContainerError()
{
return [
'type' => 'html',
'html' => <<<'HTML'
<div class="mt-2 text-sm text-red-500">
Asset container not configured.
<a class="text-red-500 underline" href="https://statamic.com/addons/statamic/seo-pro/docs#advanced-configuration" target="_blank">
Learn more
</a>
</div>
HTML,
];
}
}

0 comments on commit 6a12760

Please sign in to comment.