Skip to content

Commit 183ab27

Browse files
authored
Merge pull request #440 from pchemguy/fixed-top-navbar
Adds fixed top menu option to shell
2 parents 31bd1f5 + 5ccc5ac commit 183ab27

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/official-site/sqlpage/migrations/01_documentation.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
776776
('social_image', 'The URL of the preview image that will appear in the Open Graph metadata when the page is shared on social media.', 'URL', TRUE, TRUE),
777777
('icon', 'Name of an icon (from tabler-icons.io) to display next to the title in the navigation bar.', 'ICON', TRUE, TRUE),
778778
('menu_item', 'Adds a menu item in the navigation bar at the top of the page. The menu item will have the specified name, and will link to as .sql file of the same name. A dropdown can be generated by passing a json object with a `title` and `submenu` properties.', 'TEXT', TRUE, TRUE),
779+
('fixed_top_menu', 'Fixes the top bar with menu at the top (the top bar remains visible when scrolling long pages).', 'BOOLEAN', TRUE, TRUE),
779780
('search_target', 'When this is set, a search field will appear in the top navigation bar, and load the specified sql file with an URL parameter named "search" when the user searches something.', 'TEXT', TRUE, TRUE),
780781
('search_value', 'This value will be placed in the search field when "search_target" is set. Using the "$search" query parameter value will mirror the value that the user has searched for.', 'TEXT', TRUE, TRUE),
781782
('norobot', 'Forbids robots to save this page in their database and follow the links on this page. This will prevent this page to appear in Google search results for any query, for instance.', 'BOOLEAN', TRUE, TRUE),

sqlpage/templates/shell.handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<div class="page">
6868
{{#if title}}
6969
<header id="sqlpage_header">
70-
<nav class="navbar navbar-expand-md navbar-light">
70+
<nav class="navbar navbar-expand-md navbar-light{{#if fixed_top_menu}} fixed-top{{/if}}">
7171
<div class="container-fluid">
7272
<a class="navbar-brand flex-grow-1 overflow-hidden" href="{{#if link}}{{link}}{{else}}/{{/if}}">
7373
{{#if image}}
@@ -130,7 +130,7 @@
130130
</nav>
131131
</header>
132132
{{/if}}
133-
<main class="page-wrapper container-xl pt-3 px-md-5 px-sm-3" id="sqlpage_main_wrapper">
133+
<main class="page-wrapper container-xl pt-3 px-md-5 px-sm-3 {{#if fixed_top_menu}} mt-5{{/if}}" id="sqlpage_main_wrapper">
134134
{{~#each_row~}}{{~/each_row~}}
135135
</main>
136136
</div>

0 commit comments

Comments
 (0)