lovasoa / SQLpage

SQL-only webapp builder, empowering data analysts to build websites and applications quickly
https://sql.datapage.app
MIT License
1.29k stars 69 forks source link

sqlpage pseudo-function to get the current path #114

Closed lovasoa closed 10 months ago

lovasoa commented 10 months ago

It would be nice to have a sqlpage.path() pseudo-function that returns the current page path.

Discussed in https://github.com/lovasoa/SQLpage/discussions/110

Originally posted by **lukavia** October 23, 2023 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. ``` select 'tab' as component; select title, file as link from nav; ``` However I would like the current page to be active so I want to add a column like `IF(sqlpage.url = file, true, false) as active` My question is how to get the current page (sqlpage.url if you will) ? Thank you
lovasoa commented 10 months ago

@lukavia : this will be in v0.15. If you use docker, you can already try it using the main tag.