frappe-syntax-jinja

Generate Frappe Jinja templates with safe context and translation rules.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-jinja-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-syntax-jinja
Source: https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-jinja
Command: npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-jinja-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common Frappe Jinja template mistakes that lead to broken print/email/portal rendering, wrong formatting, missing translations, or slow and insecure templates.

Core Features & Use Cases

  • Correct template selection & structure: Use Jinja for standard Print Formats, Email/Notification templates, and Portal pages, while avoiding the wrong syntax for Report Print Formats.
  • Frappe-safe context & rendering rules: Apply the right context objects (doc, frappe, translations) and use display-safe helpers like doc.get_formatted() for fields.
  • Production-grade guardrails: Avoid N+1 queries in loops, never use Jinja in JS report templates, and prevent XSS by not using | safe on untrusted input.

Quick Start

Use this guidance when writing a Jinja-based ERPNext/Frappe Print Format for an invoice and ensure all user-facing text is wrapped with _() and all dates/currency use doc.get_formatted().

Frequently Asked Questions about frappe-syntax-jinja

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format dates and currency correctly in Frappe Jinja print formats?

To format dates and currency in Frappe Jinja print formats, use the doc.get_formatted() helper with the parent document. This ensures values respect system and document-level field configurations for safe, correct rendering.

How do I iterate through child tables in Frappe email templates without causing N+1 queries?

To iterate through child tables in Frappe templates without N+1 queries, avoid making database calls inside loops. Access existing child table data directly from the document context to maintain fast and secure rendering.

What is the correct way to handle translations in Frappe Jinja portal pages?

The correct way to handle translations in Frappe Jinja portal pages is wrapping all user-facing text with the _() function. This ensures the text is properly registered and displayed in the user's selected language.

Why are my Frappe email templates displaying raw HTML or facing XSS vulnerabilities?

Frappe templates face XSS vulnerabilities when untrusted input is rendered using the | safe filter. Remove | safe from untrusted variables to ensure automatic escaping and protect against cross-site scripting attacks.

Can I use Jinja syntax for Report Print Formats in Frappe?

You cannot use Jinja syntax for standard Report Print Formats in Frappe. Jinja is designed for standard Print Formats, Email Templates, Notification Templates, and Portal pages, while JS report templates require different syntax.

Does Frappe v14 support custom Jinja methods and filters in print formats?

Frappe v14 through v16 supports custom Jinja methods and filters in print formats via hooks. You can wire these custom methods into your template context to extend dynamic document rendering capabilities safely.