Use variable passed via include to set value of paramenter I have an include setup for Navigation which works fine if I hard code in the level of the structure I want to use. However I need this to be set differently if the nav appears in the head or the footer.

head:

      {% include "_includes/nav"
        with {
          'listType' : 'list-inline pull-right',
          'navLevel'  : '2'
        }
      %}


footer:

      {% include "_includes/nav"
        with {
          'listType' : 'list-unstyled',
          'navLevel'  : '1'
        }
      %}


The include looks like this where I want the .level('&lt;=2') to have the value passed via the include. However when I attempt this .level('&lt;=navLevel') or similar the entire nav does not render.

{% set navigation %}

 {% set pages = craft.entries.section('navigation').level('&lt;=2') %}

 &lt;ul class="{{ listType }}"&gt;
   {% nav page in pages %}
     &lt;li&gt;
       {# Check for entry type / get related entry #}
       {% if page.type == 'internalLink' %}
           {% set linkedEntry = page.sitePageLink.limit(1).first() %}
           &lt;a href="{{ linkedEntry.url }}"  data-url="{{ entry.url }}"&gt;{{ page.title }}&lt;/a&gt;
       {% endif %}

       {# Check for entry type / get offsiteLinks #}
       {% if page.type == 'offsiteLink' %}
           &lt;a href="{{ page.offSiteLink }}"  data-url="{{ entry.url }}"&gt;{{ page.title }}&lt;/a&gt;
       {% endif %}

       {% ifchildren %}
         {# dropdown not set up yet #}
          &lt;ul class="dropdown" style="background:pink"&gt;
              {% children %}
          &lt;/ul&gt;
      {% endifchildren %}

     &lt;/li&gt;
   {% endnav %}
 &lt;/ul&gt;

 {% endset %}

 {# replace data-uri with active class #}
 {{ navigation|replace({('data-url="' ~ craft.request.getUrl() ~ '"'): 'class="active"'})|raw }}


Please advise
You'll need to concatenate the string you pass to the level parameter, using the ~ operator:

{% set pages = craft.entries.section('navigation').level('&lt;='~navLevel) %}