Replies: 2 comments 1 reply
-
Hello ! There is currently no "inclusion" mechanism in SQLPage. The feature has been asked before and will be added to a later version. However, if you can do without the call to
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello,
Yes, it's a really interesting way to do.
I really have to study migrations...
Le lun. 12 févr. 2024, 10:14, Ophir LOJKINE ***@***.***> a
écrit :
… Hello !
This is currently no "inclusion" mechanism in SQLPage. The feature has
been asked before <#42> and will
be added to a later version <#20>
.
However, if you can do without the call to sqlpage.version(), a concise
and elegant solution to your problem exists already: *define your shell
in a SQL view*. This is a pure sql solution, that does not require any
special SQLPage feature:
sqlpage/migrations/0001_define_shell.sql
create view sqlpage_shell asselect
'shell' as component,
'My Website' as title,
json_group_array(category) -- this is an example
from website_sections;
index.sql
select * from sqlpage_shell;
(try online <https://www.db-fiddle.com/f/k5P3avzo21LcAX31xRQJGq/0>)
—
Reply to this email directly, view it on GitHub
<#223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOYEXYYJSPS4TLJABNHLTNDYTHMOVAVCNFSM6AAAAABDDSWPQWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIMZYHE4DA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody,
I'm trying to make a dynamic shell, that will have a dynamic title based on data in our database, and a footer containing some links and even the sqlpage version with the sqlpage.version() function.
It works fine if i write it on each page, but i'm wandering if i could use the dynamic component to create the shell, not to have to change the shell on each page, like an include in php.
I made some tries, using the examples in the documentation, but it seem that the only way is to use the sqlpage.read_file_as_text function, which is absolutely static and can't use sql request in it ?
Am i right ?
An idea of how to do ?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions