Skip to content

Instantly share code, notes, and snippets.

@piotrpog piotrpog/seomate.php Secret
Created Sep 29, 2019

Embed
What would you like to do?
<?php
$globalSettings = Craft::$app->getGlobals()->getSetByHandle('globalSeo')->globalseofields->type('settings')->one();
$sitename = ($globalSettings ? $globalSettings->suffix : null) ?: Craft::$app->getSites()->getCurrentSite()->name;
return [
'cacheEnabled' => false,
'defaultProfile' => 'standard',
'siteName' => $sitename,
'defaultMeta' => [
'description' => ['globalSeo.globalseofields:settings.description'],
'image' => ['globalSeo.globalseofields:settings.image'],
],
'fieldProfiles' => [
'standard' => [
'title' => ['seoFields:settings.alternativeTitle', 'title'],
'description' => ['seoFields:settings.description'],
'image' => ['seoFields:settings.image'],
'robots' => ['seoFields:settings.robots'],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.