-
I store several parameters for my resistors and wonder if getting them for a label is possible. Has someone implemented this already? |
Beta Was this translation helpful? Give feedback.
Answered by
samvtran
Apr 3, 2025
Replies: 1 comment 2 replies
-
I'm generating labels for part lots with a template like this: {% for param in element.part.parameters %}
<strong>{{param.name}}</strong>: {{param.formattedValue}}
{% endfor %}
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For arbitrary array access, using Twig filters like
{{element.part.parameters|first.name}}
for the first element or{{element.part.parameters|slice(0, -1)[3].name}}
for arbitrary indexes should work (full list of allowed filters). They convert theparameters
PersistentCollection to an array which you can use indexes with.My homelab inventory has lots of unrelated parts, so I can't rely on parameter indexes. Instead, I put a few parameters I actually care about in a
Label
group so they fit on small 25mm tall labels. An example of a table that CKEditor and the label generator seem happy with: