2 layman questions + 1 request #32
-
Impressed by the plugin (I've used
And request: About "pages-tagged-with" code:
``{
function getRelatedPages(relationName, relationValue) {
const query = `[:find ?name
:where
[?p :block/original-name ?name]
[?p :block/properties ?ps]
[(get ?ps :${relationName}) ?pv]
[(contains? ?pv "${relationValue}")]
]`
const result = top.logseq.api.datascript_query(query)
if (!result || result.length === 0)
return null
return result.flat()
}
const property = c.args.prop || 'tags'
const relation = c.page.name
const pages = getRelatedPages(property, relation)
console.log(pages)
if (!pages)
return `There are no pages with property <b><i>${property}</i></b> and relation [[${relation}]]`
_}``
Pages with ``dev.toHTML(ref(property))`` containing ``dev.toHTML(ref(relation))``
``'<ul>' + pages.sort().map((p) => `<li>${dev.toHTML(ref(p))}</li>`).join('') + '</ul>'``
Thank you very much |
Beta Was this translation helpful? Give feedback.
Answered by
stdword
Nov 16, 2023
Replies: 1 comment
-
Hello! Thank you for a feedback ❤️
I've just updated this template to support horizontal style layout. It is available here. ![]()
![]()
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
joaosimuai
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! Thank you for a feedback ❤️
I've just updated this template to support horizontal style layout. It is available here.
Now, thing get more complex: