-
I'm trying to a navigation to my app. Going through the docs and examples it seams the most elegant solution is to create a table with the entries and then use tab component.
However I would like the current page to be active so I want to add a column like My question is how to get the current page (sqlpage.url if you will) ? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hello and welcome to SQLPage ! This is not yet implemented, but I created an issue here: #114 For the time being, you'll just have to duplicate in each page select title, file as link, file='/my_page_xxx.sql' as active from nav; side note : |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. CREATE TABLE nav(page VARCHAR(20));
INSERT INTO nav VALUES('transactions'),('accounts'),('this month'); And then one can use: SELECT 'shell' as component, 'Transactions' as title, json_group_array(page) as menu_item from nav; or SELECT 'tab' as component;
SELECT page as title, page || '.sql' as link, (page = 'transactions') as active from nav; And then change only the string on each page. |
Beta Was this translation helpful? Give feedback.
-
I added |
Beta Was this translation helpful? Give feedback.
I added
sqlpage.path()
, it will be released in v0.15 🙂