You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a blogpost, the user has full control on what to show - HTML, CSS and JS. But what if the user want's to access data from the database, e.g. inserting the blog posts publication date just beneath the blog post heading?
Proposal:
Define certain strings, which would be replaced on rendering.
Problems:
It is to my knowledge not possible to query a string from the DB and execute Nim-code within it.
Suggestion:
I can't seem to find an elegant solution to this, so my proposal is:
Prepare a multiReplace() on the queried string from the DB with certain elements such as publication date, views, category.
Example
# user edits a blog post from the browser interface
<divid="mainContainer" class="blogpost"><h1>New blog</h1><div>${category}</div><div>${views}</div><div>
# routesget"/blog/newblogpage":
let data = query-DB-to-fetch-data()
resp data.multiReplace([("${category}", "Cats"), ("${views}", viewCount)])
Before
After
The text was updated successfully, but these errors were encountered:
When writing a blogpost, the user has full control on what to show - HTML, CSS and JS. But what if the user want's to access data from the database, e.g. inserting the blog posts publication date just beneath the blog post heading?
Proposal:
Define certain strings, which would be replaced on rendering.
Problems:
It is to my knowledge not possible to query a string from the DB and execute Nim-code within it.
Suggestion:
I can't seem to find an elegant solution to this, so my proposal is:
multiReplace()
on the queried string from the DB with certain elements such as publication date, views, category.Example
Before
After
The text was updated successfully, but these errors were encountered: