Skip to content
Franco Mussopower pages
Code snippet

For loop – output a HTML list

Copy it with the button on the code. For the why and the walkthrough, see “For – loop through records and populate web templates”.

For loop - output a HTML listLiquid
<!-- Step 1 - Retrieve a list of tracks (songs) liked by the logged in portal user -->
{% fetchxml liked_songs_query %}
  <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="musdyn_like">
    <attribute name="musdyn_name" />
  </entity>
</fetch>
{% endfetchxml %}
 
<!-- Step 2 - output the list -->
<ul>
{% for result in liked_songs_query.results.entities %}
  <li>{{ result.musdyn_name }}</li>
{% endfor %}
</ul>

Search

Book a discovery call

30 minutes. Bring your trickiest Power Pages problem — I’ll tell you honestly whether I’m the right fit.