mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
Mark submenu items with children as folders
Add an arrow to submenuitems that have undelying pages
This commit is contained in:
parent
5a29f0c9ba
commit
7e7b67548e
@ -494,6 +494,10 @@ class DocumentationService {
|
||||
$page->setVersion($version);
|
||||
$page->setLang($lang);
|
||||
|
||||
// does this page act as a folder?
|
||||
$path = $page->getPath();
|
||||
if (is_dir($path)) { $page->setIsFolder(true); }
|
||||
|
||||
$output->push($page);
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,24 @@ class DocumentationPage extends ViewableData {
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
/**
|
||||
* @var Boolean
|
||||
*/
|
||||
protected $IsFolder = false;
|
||||
|
||||
/**
|
||||
* @param Boolean
|
||||
*/
|
||||
function setIsFolder($isFolder = false) {
|
||||
$this->IsFolder = $isFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Boolean
|
||||
*/
|
||||
function getIsFolder($isFolder = false) {
|
||||
return $this->IsFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DocumentationEntity
|
||||
|
@ -276,4 +276,7 @@ fieldset { border: none; }
|
||||
background: -ms-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* IE10+ */
|
||||
background: linear-gradient(to bottom, #599BDC 1%,#3072B3 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#599BDC', endColorstr='#3072B3',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
}
|
||||
|
||||
/* contains the arrow that marks a folder */
|
||||
span.is-folder {float: right;}
|
@ -8,7 +8,9 @@
|
||||
<% if Children %>
|
||||
<ul>
|
||||
<% control Children %>
|
||||
<li><a href="$Link" class="$LinkingMode">$Title</a>
|
||||
<li><a href="$Link" class="$LinkingMode">
|
||||
$Title <% if IsFolder %><span class="is-folder">►</span><% end_if %>
|
||||
</a>
|
||||
<% if Children %>
|
||||
<ul>
|
||||
<% control Children %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user