Logmanager documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

With item

Block defines context manager instance to be used with With statement and optionally assigned to variable. Variable is valid only inside of wrapping with statement.

Block XML representation

XML representation of with_item block

<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="with_item">
    <value name="VAR">
      <block type="function_context">
        <field name="NAME">bd0e8ea7-002a-4d5e-87af-6c623daf4b60</field>
        <value name="VALUE">
          <block type="text">
            <field name="TEXT">default</field>
          </block>
        </value>
      </block>
    </value>
    <value name="VALUE">
      <block type="variables_get">
        <field name="VAR" variabletype="">context_variable</field>
      </block>
    </value>
  </block>
</xml>

Example of visual representation

Block "With item"

Block “With item”