80603

Include Statement inside jina2 that use a Variable for the included filename

Question:

I am trying to do this:

{% for a in as %} {% include "{(a}}.jinja"%} {% endfor %}

But i am getting an Error, that {a}.jinja is Not found. So it seems that it does Not substitude the Variable. Why? How can i fix this?

Answer1:

Inside the {%%} Block, i Can use variables directly. This Works:

{% include a + ".jinja" %}

Recommend

  • Status of the “marker” keyword in Jinja
  • How do I create a jinja2 filter and use it within pylons?
  • Variable within filename in jinja2 [duplicate]
  • JSON.parse() in Swig (Node.js)?
  • Trimming blocks using whitespace control from jinja2 template
  • Jekyll: Cannot render YAML front matter field as markdown correctly
  • MYSQL select all records where username and date pair occur more than once
  • set table random value from table
  • Responsive left sidebar open close
  • Prevent page break in text block with iText, XMLWorker
  • C++ friend class std::vector
  • SyntaxError: (irb):26: both block arg and actual block given
  • blade.php method outputting it's result to the form
  • Thread 1: EXC_BAD_ACCESS (code =1 address = 0x0)
  • How to know when stdin is empty if it contains EOF?
  • Meteor helpers not available in Angular template
  • Regex thinks I'm nesting, but I'm not
  • Bug in WPF DataGrid
  • How to recover from a Spring Social ExpiredAuthorizationException
  • TFS: Get latest causes slow project reloading
  • How to extract text from Word files using C#?
  • Javascript Callbacks with Object constructor
  • ILMerge & Keep Assembly Name
  • How to make Safari send if-modified-since header?
  • Why is the timeout on a windows udp receive socket always 500ms longer than set by SO_RCVTIMEO?
  • Weird JavaScript statement, what does it mean?
  • Large data - storage and query
  • How do you troubleshoot character encoding problems?
  • WOWZA + RTMP + HTML5 Playback?
  • How to format a variable of double type
  • Buffer size for converting unsigned long to string
  • Hits per day in Google Big Query
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • How to get Windows thread pool to call class member function?
  • Linking SubReports Without LinkChild/LinkMaster
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Does armcc optimizes non-volatile variables with -O0?
  • How to Embed XSL into XML
  • Conditional In-Line CSS for IE and Others?