web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Where can we learn the...
Power Pages
Answered

Where can we learn the full API for content snippet logic?

(0) ShareShare
ReportReport
Posted on by 299

Is there a full blown API on snippet logic for Power Pages?  I noticed that within one of my content snippets, a sample conditional logic like so...

<a href='~/'>
{% if snippets['Logo URL'] %}<img src='{{ snippets['Logo URL'] }}' alt='{{ snippets['Logo alt text'] }}' style='width: auto; height: 32px; margin: 0 10px;'>{% endif %}
{% if snippets['Site name'] %}
<h1 class='siteTitle'>{{ snippets['Site name'] }}</h1>
{% endif %}
</a>

 

That looks a lot like the Nunjucks Template Engine.  What is it officially?  and where can we see the full API for it?

Categories:
I have the same question (0)
  • Verified answer
    Resolutions Profile Picture
    125 on at

    @kensley I hope you are doing fantastic. The code snippet you’ve shared indeed resembles the Nunjucks Template Engine syntax. However, in the context of Power Pages, this functionality is officially referred to as content snippet logic. It allows you to dynamically customize content by embedding conditional statements within your web pages.

    Here’s how it works:

    • You can use placeholders like {{ snippets['Logo URL'] }} or {% if snippets['Site name'] %} to access values stored in content snippets.
    • The snippet logic evaluates conditions (such as whether a snippet exists) and dynamically renders content accordingly.
    • While it resembles Nunjucks, it’s specifically tailored for Power Pages.

    For detailed information and examples, explore the official documentation on customizing content using snippets on Microsoft Learn . There, you’ll find the full API reference and guidelines for leveraging this powerful feature. 

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up. Also, how are you doing today? Remember, every challenge is an opportunity for growth.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Valantis Profile Picture

Valantis 41

#2
sannavajjala87 Profile Picture

sannavajjala87 28 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 26

Last 30 days Overall leaderboard