Thanks. I must be stupid - I tried the last 2 hours trying to get this to work and I can’t figure it out. I went to your steps here:
and I’m stuck at the create view section - I’ve been copying and pasting the code into logseq but I don’t know how to get that code to run properly. Can I get a little more assistance? Sorry I’m new to logseq and plugins in general.
That workedI I think it was the way I was copying and pasting - when I used the github copy vs just selecting it didnt give me any errors.
The only problem I have left is it seems to be incompatible with the built in query function in logseq?
For example, I have on each client page a page property set as such:
last-contact:: {{renderer :template-view, last reference date, :reversed “”, :default “”}}
And then I have a separate page called “All Clients” that basically pulls in page properties from each client. But for the column “last-contact”, the entries are all blank in the query search despite on the page property it showing the proper date.
{{query (page-property :status “Prospective Client”)}}
Yep that seems to work but very tedious/cumbersome. Is there any way to make the workaround smoother? Even something like having the renderer macro code in a separate block and then having the page property automatically reference the block right below or something? It’s really the manual step of getting each unique block reference code in every last-contact field that makes it painful and not very scalable across hundred+ clients
Is there a way you can also submit to the logseq github this bug so they fix it hopefully? I would do it myself but I dont quite understand the interaction between your plugin and how it causes this problem with the logseq query function (and they may put the blame on your plugin rather than the core app) so I think you may be able to provide better context or even submit a git pull request if you are familiar with their codebase.
My programming knowledge unfortunately is limited to basic python
Sorry I dont follow. the UUID of the block will dynamically update or do I still have to manually enter in the UUID of the block each time for each client page?
Oh no I’m not using python to generate the client pages, I just mentioned that as my very limited coding ability.
Great thanks a lot for the help - let me know if you are able find a slightly more elegant workaround. hopefully they can fix it soon although it looks like there are 1000+ issues outstanding still.
I’ll tip you some for your beer fund later really appreciate the help.
Done! We can write a special template to create client pages, which can emulate the creation of manual block:
So, you only need to insert that special template to create a client page. But every client page need to be created manually. We cannot create 100+ pages at once with the template.
template:
- template:: new client
- ```javascript
``{
var content = '{{renderer :template-view, last reference date, :reversed "", :default ""}}'
var block = top.logseq.api.append_block_in_page(c.page.name, content)
}``
last-contact:: {{embed ((``block.uuid``))}}
```
I can’t seem to get this to work when I try to paste it in. Should I be removing the first dash when copying it into logseq? logseq keeps saying it does not support multiple unordered lists when I try to paste it in
EDIT: I kind of got it to work, when I delete all the other page properties I had in my template. I’m not sure why I am having issues if I have other page properties in, may be formatting.
If I wanted to use your template but include the following other page properties, what would be the proper formatting?
Also one other possible bug - when I type /template, I get two options. One called Template which is the default template option in logseq and another called Insert Template or View which I think is your plugin. But when I do the option for your plugin, if I have multiple templates or want to select one, I can no longer select it using the down arrow key and I have to manually select it with my mouse cursor. Is this a bug too (albeit a minor one)? If I select the first “Template” option that is part of official logseq, I’m able to use arrow keys to navigate to whichever template I want to select.
Hot to insert template with the plugin (and not with the build-in template system)?
There are three ways:
Via default shortcut: ⌘T (Ctrl+T for Windows)
Via /-command «Insert template or view»
Via block context menu: right mouse click on root block with the template and select «Copy as template»
Arrow keys do work. Just checked — it is worked for me on Mac and on Windows. Via /-command and via shortcut. I don’t know the reason it doesn’t work for you. Try to get out mouse pointer from opened window with templates list — this may help.
strange - I can’t get the arrows keys working when I’m in “insert template or view” option even with the mouse pointer is outside of the template list (doesn’t make any difference). I’m using Mac OS version 0.10.3. Which one are you on? We may be on different versions - I dont get those arrow keys or inputs to popup like yours does either.
It shouldn’t relates to Logseq’s version. I’am using the same one: v0.10.3.
The only things I can offer here is trying to restart Logseq or experimenting with other keyboards / machines. Does the issue still present in this cases? And ensure the input field is focused.
Oh! Yeah! The simple references also works!
Relaces embed macro with simple block reference in template:
template
- template:: new client
- ```javascript
``{
var content = '{{renderer :template-view, last reference date, :reversed "", :default ""}}'
var block = top.logseq.api.append_block_in_page(c.page.name, content)
}``
last-contact:: ``[block.uuid]``
```