-
DescriptionWhen creating a template with a table, I noticed that the formatting that can be seen in the template preview is apparently not applied or only partially applied when the note is used. I have attached a simple template that extracts a few bibliographic information into a table with a formatted header. ScreenshotsPreview in the Template-EditorCreated Note (Select Entry -> Create Item Note from Template)Test on Zotero version7.0.7 Test on Better Notes version2.0.17 Template TypeItem Template Share Code# This template is specifically for importing/sharing, using better
# notes 'import from clipboard': copy the content and
# goto Zotero menu bar, click Tools->New Template from Clipboard.
# Do not copy-paste this to better notes template editor directly.
name: "[item]TestColoredTable"
zoteroVersion: "7.0.7"
pluginVersion: "2.0.17"
savedAt: "2024-10-21T10:29:55.341Z"
content: |-
// @use-markdown
<!-- Preface -->
// @author https://github.com/JAC28
// @default-begin
<!-- Title -->
<h1> 0 Table-Test </h1>
<h2> Metadata </h2>
<p>
<table id="titleData">
<tr style='background-color: #008c4f; color: #ffffff' ><th>Param</th><th>Value</th></tr>
<tr>
<th>Title</th><td>${topItem.getField("title")}</td>
</tr>
<tr>
<th>Authors</th><td>${topItem.getCreators().slice(0, 2).map((v) => v.firstName + " " + v.lastName).join(", ") + (topItem.getCreators().length > 2 ? " et al." : "")}</td>
</tr>
<tr>
<th>Journal</th><td>${topItem.getField('publicationTitle')}</td>
</tr>
<tr>
<th>Year</th><td>${topItem.getField("date").split('T')[0].split('-')[0]}</td>
</tr>
</table>
</p>
<h2>Notes</h2>
<br>
// @afterloop-begin
${{if (_env.dryRun){
return ""}
else {
targetNoteItem.addTag('TabularEvaluation');
return ""}
}}$
// @afterloop-end Anything elseNo response |
Beta Was this translation helpful? Give feedback.
Answered by
JAC28
Oct 21, 2024
Replies: 1 comment 1 reply
-
See examples like #1155 |
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
Thank you for the quick and helpful answer. To document the solution:
Despite the correct formatting within the template preview e.g. based on styling for the total table row such as
the styling is not applied correctly to the created note. Instead, the formatting has to be defined for each cell individually. For the given application, for example: