Overriding variables

Dan Rey Oquindo's Avatar

Dan Rey Oquindo

07 Feb, 2018 03:13 AM


We need to display something like this

  if has_membership_related_items?
     <h1> "Membership Fees"
     loop membership_related_items

  if has_event_related_items?
   <h1> "Event Fees
   loop event_related_items

can you please help on how to achieve such... Or point me to the correct documentation.. Thanks

  1. Support Staff 1 Posted by Scott Tadman on 07 Feb, 2018 04:52 PM

    Scott Tadman's Avatar

    You can create repeated sections with the {{:x}}...{{/x}} notation where that
    references a subsection of your data, and conditionals with {{?x}}...{{/x}}.

    It's easier to demonstrate:

      <h1> "Membership Fees"

    This depends on having a particular JSON structure, one that looks like:

      "other_variable": "x",
      "membership_related_items": [
          "item1": "valueA",
          "item2": "valueB"
          "item1": "valueC",
          "item2": "valueD"

    Where so long as the membership_related_items key is present the {{?}}
    section will trigger, and within that it will iterate over the elements
    in that array, rendering out each section repeatedly.

    Let me know if that works for you, and if you have any trouble I'll do what I can to help.

Discussions are closed to public comments.
If you need help with PostageApp please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac