diff --git a/code/DocumentationManifest.php b/code/DocumentationManifest.php index a033614..2e74b34 100644 --- a/code/DocumentationManifest.php +++ b/code/DocumentationManifest.php @@ -61,6 +61,11 @@ class DocumentationManifest */ private $entity; + /** + * @var boolean + */ + private $has_default_entity = false; + /** * @var boolean */ @@ -157,6 +162,9 @@ class DocumentationManifest if (isset($details['DefaultEntity'])) { $entity->setIsDefaultEntity($details['DefaultEntity']); + if ($entity->getIsDefaultEntity()) { + $this->has_default_entity = true; + } } $this->registeredEntities->push($entity); @@ -760,4 +768,13 @@ class DocumentationManifest return $versions; } + + /** + * Gets whether there is a default entity or not + * @return boolean + */ + public function getHasDefaultEntity() + { + return $this->has_default_entity; + } } diff --git a/code/controllers/DocumentationViewer.php b/code/controllers/DocumentationViewer.php index 620db8a..1303b88 100755 --- a/code/controllers/DocumentationViewer.php +++ b/code/controllers/DocumentationViewer.php @@ -710,4 +710,14 @@ class DocumentationViewer extends Controller { return Config::inst()->get('DocumentationViewer', 'link_base'); } + + /** + * Gets whether there is a default entity or not + * @return boolean + * @see DocumentationManifest::getHasDefaultEntity() + */ + public function getHasDefaultEntity() + { + return $this->getManifest()->getHasDefaultEntity(); + } } diff --git a/templates/Includes/DocumentationSidebar.ss b/templates/Includes/DocumentationSidebar.ss index 3ecc8bd..8150b73 100644 --- a/templates/Includes/DocumentationSidebar.ss +++ b/templates/Includes/DocumentationSidebar.ss @@ -3,10 +3,14 @@ $DocumentationSearchForm