Hello Herb, I hope that you’re doing well. I’m in the middle of a small project that involves customizing a display template and I came across a few things.
-
The
<?allfields?>
merge command writes the entiredisplay.html
into the body of a note. This is not obvious from within Notenik, but when inspecting the (very useful)temp_display.html
file it is evident.For example the following:
<body> <?allfields?> <?if "=$IndividualFields$=" ?> <!-- For Detailed Formatting Control, Uncomment these lines: <?if "=$tags$=" ?> <p><em>=$tags$=</em></p> <?endif?> <p><strong>=$title&h$=</strong></p> <?if "=$backlinks$=" ?> <p>Backlinks: =$backlinks$=</p> <?endif?> <?if "=$wikilinks$=" ?> <p>Wiki Links: =$wikilinks$=</p> <?endif?> <?if "=$body$=" ?> =$bodyw1o$= <?endif?> --> <?endif?> </body>
Results in a body element in
temp_display.html
that consists of itself:<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>2023-01-08 Sunday</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style> ... /* Notenik's default CSS styles */ ... </style> </head> <body> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>2023-01-08 Sunday</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style> ... /* The default CSS again */ ... </style> </head> <body> ... <!-- The note rendered in HTML --> ... </body> </html> </body> </html>
What is strange is that even if the CSS styling within the
<style>
element is completely different from the default, the default style will be put into the duplicate HTML document that appears within the note’s<body>
element. -
The
=$bodyw1o$=
in the default display.html file is missing the ampersand before the variable modifiers (it should instead be=$body&w1o$=
). -
Backlinks do not render as functional links in the same way that Wikilinks which appear in a note’s body do.
-
=$backlinks$=
and=$backlinks&w1$=
results in text like2023-01-13 Friday;;
that is not a link (i.e. it is plain text with the two semicolons included). -
=$backlinks&w1o$=
and=$backlinks&o$=
will result in an HTML link that points to2023-01-13-friday.html
for example, instead ofhttps://ntnk.app/20230113friday
which customarily points to the note within Notenik.
-
-
Tags are not linkable in a way that will display the corresponding tag in Notenik’s sidebar when they appear in a note as a result of a
=$tags$=
variable.E.g.
<?allfields?>
yields the following code:<p><em><a href="notenik://expand?path=/Users/user/Daily%20Notes/&tag=blog" style="text-decoration: none">blog</a>, <a href="notenik://expand?path=/Users/user/Daily%20Notes/&tag=design" style="text-decoration: none">design</a></em></p>
=$tags$=
results in only:<p><em><a href='blog' rel='tag'>blog</a>, <a href='design' rel='tag'>design</a></em></p>
Perhaps there may be a difference in how Notenik generates fields in unison via the <?allfields?>
command and how it does so when the fields are called upon individually?
As always, thank you for your work. Please let me know if there is any other information that you’d like for me to offer.