Using <!-- {{#each itemList}} -->

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashballan
    Member
    • Apr 2018
    • 66

    Using <!-- {{#each itemList}} -->

    I have an entity called "Item" and another called "Event" with relationship one-to-many (Event->Items).

    I'm creating a PDF template and using the "<!-- {{#each itemList}} -->" code as described in the docs, here is the snippet:
    <!-- {{#each itemsNames}} -->
    <tr>
    <td><p>{{name}}</p></td>
    </tr>
    <!-- {{/each}} -->

    But all I get is a "?" in the PDF. The placeholder {{itemsNames}} is a valid one in the list. What am I doing wrong!?
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hi,
    for now you can use itemsIds field only. itemsNames is an object, this field type is not supported in template parsing
    Hi there I have an entity called &quot;MyEntity&quot; with a linkMultiple called &quot;lots&quot;. I created a Template and put : Capture d’écran 2017-10

    Comment

    • ashballan
      Member
      • Apr 2018
      • 66

      #3
      Thank you.. so how do I get the name of the item now? I used {{name}} but nothing was displayed:
      <!-- {{#each itemsIds}} -->
      {{name}}<br>
      <!-- {{/each}} -->

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        <!-- {{#each itemsIds}} -->
        {{this}}<br>
        <!-- {{/each}} -->

        itemsIds field contains only list of related ids. Maybe it will be added in the next version (can't promise).
        But 100% way is develop manually additional not storable varchar field, which will contain concatenated related items name

        Comment

        • ashballan
          Member
          • Apr 2018
          • 66

          #5
          tanya thanks for your support, I appreciate it. I solved it in a more "manual" way to avoid complications.

          Comment

          Working...