| | |
| | | $content = is_array($registrar->registrar->for) ? $registrar->registrar->for[0] : $registrar->registrar->for; |
| | | $contentRegistrar = Registrar::getInstance($content); |
| | | |
| | | $crumbs[] = [ |
| | | 'name' => $contentRegistrar->getConfig('breadcrumbs')['title']??$contentRegistrar->getPlural(), |
| | | 'url' => get_post_type_archive_link(jvbCheckBase($content)), |
| | | ]; |
| | | if($contentRegistrar && $contentRegistrar->hasFeature('show_directory')) { |
| | | $directory = JVB()->directories(); |
| | | if ($directory && !empty($directory->directories($content)??[])){ |
| | | $crumbs[] = [ |
| | | 'name' => $directory->directories($content)['title'], |
| | | 'url' =>$directory->directories($content)['url'] |
| | | ]; |
| | | } |
| | | } else { |
| | | $crumbs[] = [ |
| | | 'name' => $contentRegistrar->getConfig('breadcrumbs')['title']??$contentRegistrar->getPlural(), |
| | | 'url' => get_post_type_archive_link(jvbCheckBase($content)), |
| | | ]; |
| | | } |
| | | // $crumbs[] = [ |
| | | // 'name' => 'By ' . $registrar->getSingular(), |
| | | // 'url' => false, |
| | |
| | | $name = jvbNoBase($type); |
| | | |
| | | $registrar = Registrar::getInstance($name); |
| | | if (Site::has('is_directory') && $name === 'directory') { |
| | | |
| | | if($registrar && $registrar->hasFeature('show_directory')) { |
| | | $directory = JVB()->directories(); |
| | | if ($directory && !empty($directory->directories($name)??[])){ |
| | | $crumbs[] = [ |
| | | 'name' => $directory->directories($name)['title'], |
| | | 'url' =>$directory->directories($name)['url'] |
| | | ]; |
| | | } |
| | | } elseif (Site::has('is_directory') && $name === 'directory') { |
| | | $crumbs[] = [ |
| | | 'name' => JVB()->directories()->referAs(true), |
| | | 'url' => get_post_type_archive_link($type) |
| | | ]; |
| | | } elseif (is_post_type_archive() && $registrar && $registrar->hasFeature('show_directory')) { |
| | | |
| | | } elseif ($registrar) { |
| | | $crumbs[] = [ |
| | | 'name' => $registrar->getConfig('breadcrumbs')['title'] ?? $registrar->getPlural(), |
| | | 'url' => get_post_type_archive_link($type) |
| | | 'name' => $registrar->getConfig('breadcrumbs')['title'] ?? $registrar->getPlural(), |
| | | 'url' => get_post_type_archive_link($type) |
| | | ]; |
| | | } else { |
| | | $crumbs[] = [ |
| | | 'name' => $obj->label, |
| | | 'url' => get_post_type_archive_link($type) |
| | | ]; |
| | | } |
| | | |