diff --git a/app/src/Widgets/SubmenuWidget.php b/app/src/Widgets/SubmenuWidget.php new file mode 100644 index 0000000..235286e --- /dev/null +++ b/app/src/Widgets/SubmenuWidget.php @@ -0,0 +1,39 @@ +'; + private static $table_name = 'SubmenuWidget'; + + public function getPage() + { + $area = $this->Parent(); + return \Page::get()->filter('SideBarID', $area->ID)->first(); + } + + public function getSubmenu() + { + $page = $this->getPage(); + + $children = $page->Children(); + $children = $children->count() ? $children : $page->Level(1)->Children(); + + return $children; + } +} diff --git a/app/templates/Page.ss b/app/templates/Page.ss index 31871f3..3e9fd61 100644 --- a/app/templates/Page.ss +++ b/app/templates/Page.ss @@ -20,7 +20,7 @@ $Breadcrumbs <% end_if %> - <% if $SideBarView && $SideBar.Widgets.Count %> + <% if $SideBarView && $SideBarView.Widgets.Count %>
diff --git a/app/templates/Site/Widgets/BannerWidget.ss b/app/templates/Site/Widgets/BannerWidget.ss new file mode 100644 index 0000000..8f85dda --- /dev/null +++ b/app/templates/Site/Widgets/BannerWidget.ss @@ -0,0 +1,8 @@ +$Title +<% if $Link %> + <% with $Link %> + target="_blank"<% end_if %> class="stretched-link"> + $Up.Title + + <% end_with %> +<% end_if %> diff --git a/app/templates/Site/Widgets/SubmenuWidget.ss b/app/templates/Site/Widgets/SubmenuWidget.ss new file mode 100644 index 0000000..2eb1699 --- /dev/null +++ b/app/templates/Site/Widgets/SubmenuWidget.ss @@ -0,0 +1,9 @@ +<% if $Submenu %> + +<% end_if %> diff --git a/package.json b/package.json index 8ab29cb..1629531 100755 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ ], "dependencies": { "@a2nt/meta-lightbox": "^1.2.2", - "@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^1.3.0", - "yarn": "^1.21.0" + "@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^1.3.2", + "yarn": "^1.21.1" }, "devDependencies": { "@google/markerclusterer": "^1.0.3", @@ -55,7 +55,7 @@ "core-util-is": "^1.0.2", "croppie": "^2.6.4", "cross-env": "^5.2.1", - "css-loader": "^3.3.0", + "css-loader": "^3.3.1", "eslint": "^4.18.1", "eslint-plugin-import": "^2.19.1", "eslint-plugin-jquery": "^1.5.1", @@ -104,7 +104,7 @@ "smooth-scroll": "^14.2.1", "style-loader": "^0.19.0", "svg-url-loader": "^2.3.3", - "terser-webpack-plugin": "^2.2.2", + "terser-webpack-plugin": "^2.3.0", "uglify-js": "git://github.com/mishoo/UglifyJS2.git#harmony-v2.8.22", "uglifyjs-webpack-plugin": "^2.2.0", "url-loader": "^0.6.2",