Closed florian-bellencontre closed 1 month ago
Hi! You can use https://sql.datapage.app/functions.sql?function=run_sql for that!
You can do it with
select 'dynamic' as component, sqlpage.run_sql('shell.sql') as properties;
and shell.sql :
select
'shell' as component,
sqlpage.cookie('lightdarkstatus') as theme;
It works perfectly, thanks for the help and sorry for creating an issue rather than a discussion.
What are you building with SQLPage ?
I'm creating a web interface to manage account creation and management via proftpd. And I want to add a toggle to activate the dark mode.
What is your problem ? A description of the problem, not the solution you are proposing.
I'm looking to use the following toggle example: https://github.com/lovasoa/SQLpage/tree/main/examples/light-dark-toggle
I'd like to use the dynamic component with a file and not by storing the information in a database.
What are you currently doing ? Since your solution is not implemented in SQLPage currently, what are you doing instead ?
I currently have this code:
shell.json
I would like to be able to do this:
I don't know if this is easily doable but it would be really cool.
Thanks in advance ;)