';
}
$fieldConfig = $this->registry->getFieldDefinition($fieldName);
if (!$fieldConfig) {
continue;
}
echo Form::render($fieldName, $config[$fieldName]??'', $fieldConfig);
if ($index === 0 && $fieldName === 'type') {
echo '
';
}
}
?>
schema()['type'] ?? 'Organization';
$tabs = new Tabs();
$tabs->addTab('website')
->title('WebSite Schema')
->icon('globe-simple')
->description('This is the main definition for your website')
->content($this->renderForm('website', 'WebSite'));
$tabs->addTab('organization')
->title('Organization Schema')
->icon('storefront')
->description('Define your organization or local business here.')
->content($this->renderForm('organization', $savedBusiness));
return $tabs->render();
}
protected function renderConfig(string $type):string
{
$types = ['meta', 'schema'];
if ($type == 'content') {
$types[] = 'archive';
}
$registrar = Registrar::getInstance($type);
if (!$registrar){
return '';
}
$config = $registrar->getConfig('seo');
$mainTabs = new Tabs();
foreach ($config as $c => $opt) {
$subTabs = new Tabs();
foreach ($types as $t) {
$tab = $subTabs->addTab($c.'_'.$t);
switch ($t) {
case 'meta':
$tab->title('Meta')
->icon('folders')
->description('The title and description are used when a link is shared to social media and a preview shows, or in the search engine result for this page.')
->content($this->renderForm($c, null, $t));
break;
case 'schema':
$tab->title('Schema')
->icon('robot')
->description('Defining the schema helps search engines understand what the content of this page is about.')
->content($this->renderForm($c, null, $t));
break;
case 'archive':
$tab->title('Archive')
->icon('hard-drives')
->description('The archive is similar to the per-post schema for this content, but is generally a CollectionPage of some sort.')
->content($this->renderForm($c, null, $t));
break;
}
}
$mainTabs->addTab($c)
->title($opt['plural'])
->icon($opt['icon'])
->content($subTabs->render());
}
return $mainTabs->render();
}
/**
* Render admin styles
*/
private function renderStyles(): void
{
jvbInlineStyles('forms');
}
protected function renderTemplates():void
{
$types = array_keys($this->registry->schemaTypes);
foreach ($types as $type) {
?>
registry->getFieldsForType($type);
foreach ($fields as $fieldName) {
$config = $this->registry->getFieldDefinition($fieldName);
if (!$config) {
continue;
}
echo Form::render($fieldName, '', $config);
}
?>