<div class="row sidebar">
  {% if page.header.danger == 1 %}
    <div class="columns small-12 extra_content">
    {% if lang == "fr" %}
      <a href="{{page.find('membres-en-danger').url}}" >Nos membres en danger</a>
      {% else %}
        <a href="{{page.find('membres-en-danger').url}}" >Our members in danger</a>
    {% endif %}
      
    </div>
  {% endif %}
  {% if page.slug == "appel-a-dons" %}
    <div class="columns small-12 extra_content">
    <iframe id="haWidget" allowtransparency="true" src="https://www.helloasso.com/associations/tournons-la-page/formulaires/1/widget-bouton" style="width:100%;height:70px;border:none;"></iframe>
      
    </div>
  {% endif %}
  {% for element in page.header.post_sidebar %}

    <div class="columns large-12 medium-12 small-12">

      {% set break = false %}
      {% set value = "" %}
      {% for key,type in element.type_info if not break %}
        {% if type == true %}
          {% set value = key %}
          {% set break = true %}
        {% endif %}
      {% endfor %}

      {% if value == 'pages'%}
          {% set url_fetch = element.page  %}
          {% set title = page.find(url_fetch).title %}
          {% set tag = page.find(url_fetch).taxonomy.tag[0] %}
          {% set url = base_url ~ element.page  %}
      {% elseif value == 'url' %}
          {% set url = element.url  %}
          {% set title = element.title %}
          {% set tag ="liens" %}
      {% elseif value == 'ressources' %}
          {% set title = element.ressources  %}
          {% set ressources_collection = page.find("/outils-et-ressources").header%}
          {% set break = false %}
          {% for key,r in ressources_collection.images if not break %}
            {% if r.title == title %}
            {% set tag = r.tag[0] %}
            {% set url = page.find("/outils-et-ressources").url~"/title:"~r.title|hyphenize %}
            {% set break = true %}
            {% endif %}
          {% endfor %}
          {% for key,r in ressources_collection.doc if not break %}
            {% if r.title == title %}
            {% set tag = r.tag[0] %}
            {% set url = base_url ~"/"~r.doc|first.path %}
            {% set break = true %}
            {% endif %}
          {% endfor %}
          {% for key,r in ressources_collection.vid if not break %}
            {% if r.title == title %}
            {% set tag = r.tag[0] %}
            {% set url = r.url %}
            {% set break = true %}
            {% endif %}
          {% endfor %}
      {% endif %}

      <a target="_blank" href="{{url}}"><mark>{{ title }}</mark></a>
      <span class="tag" ><span>{{ tag }}</span></span>


    </div>

  {% endfor %}


</div>
