{"id":1024,"date":"2024-12-16T13:53:41","date_gmt":"2024-12-16T12:53:41","guid":{"rendered":"https:\/\/agripedia.ch\/wasserforum\/?page_id=1024"},"modified":"2026-03-25T15:17:32","modified_gmt":"2026-03-25T14:17:32","slug":"projekte-uebersicht","status":"publish","type":"page","link":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/projekte-uebersicht\/","title":{"rendered":"Projekte"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"355\" src=\"https:\/\/agripedia.ch\/wasserforum\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-1024x355.jpg\" alt=\"\" class=\"wp-image-60853\" srcset=\"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-1024x355.jpg 1024w, https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-300x104.jpg 300w, https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-768x266.jpg 768w, https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-1536x533.jpg 1536w, https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-2048x710.jpg 2048w, https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-1200x416.jpg 1200w, https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2025\/04\/Projekte-schmal-kleiner-1980x687.jpg 1980w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-normal-font-size\">Hier k\u00f6nnen Sie sich \u00fcber laufende und abgeschlossene Projekte zum Thema Wassermanagement in der Landwirtschaft informieren. Nutzen Sie daf\u00fcr den untenstehenden Filter. Wir freuen uns \u00fcber Ihre Informationen zu weiteren Projekten, welche Sie <a href=\"https:\/\/agripedia.ch\/wasserforum\/?page_id=1023\">hier <\/a>einreichen k\u00f6nnen.<\/p>\n\n\n\n<p class=\"has-normal-font-size\">Auf der Klimaplattform der AGRIDEA sind die Projekte der Kantone unter anderem zum Thema Wasser und Bew\u00e4sserung aufgelistet (via Filter Wasser\/Trockenheit): <a href=\"https:\/\/agripedia.ch\/klima\/aktivitaeten-der-kantone\/\">Aktivit\u00e4ten der Kantone &#8211; Plattform Klima<\/a><\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<!DOCTYPE html>\n<html lang=\"de\">\n<head>\n  <meta charset=\"UTF-8\" \/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/>\n  <title>Excel Filter Auswahl<\/title>\n  <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/xlsx\/0.17.0\/xlsx.full.min.js\"><\/script>\n  \n<\/head>\n<body>\n  <div class=\"filter-box\">\n    <div class=\"filter-header\">Filter mit Dropdowns + Keywords rechts (tippen oder mehrfach ausw\u00e4hlen)<\/div>\n    <div class=\"filter-body\">\n      <div class=\"filter-left\">\n        <label>Status<\/label>\n        <select id=\"statusFilter\"><option value=\"\">&#8211; Ausw\u00e4hlen &#8211;<\/option><\/select>\n\n        <label>Themenbereich<\/label>\n        <select id=\"themenbereichFilter\"><option value=\"\">&#8211; Ausw\u00e4hlen &#8211;<\/option><\/select>\n\n        <label>Region<\/label>\n        <select id=\"regionFilter\"><option value=\"\">&#8211; Ausw\u00e4hlen &#8211;<\/option><\/select>\n\n        <label>Sprache<\/label>\n        <select id=\"spracheFilter\"><option value=\"\">&#8211; Ausw\u00e4hlen &#8211;<\/option><\/select>\n\n        <div class=\"filter-actions\">\n          <span id=\"applyFiltersLeft\">Filter<\/span>\n          <span id=\"resetFiltersLeft\">Zur\u00fccksetzen<\/span>\n        <\/div>\n      <\/div>\n\n      <div class=\"filter-right\">\n        <div class=\"search-wrapper\">\n          <label for=\"keywordsInput\">Keywords<\/label>\n          <input\n            type=\"text\"\n            id=\"keywordsInput\"\n            placeholder=\"Keywords tippen (kommagetrennt), z.B. Erosion, Starkregen\"\n          \/>\n          <div class=\"helper-text\">\n            Tipp: Mehrfachauswahl im Feld unten mit <b>Ctrl<\/b> (Windows) \/ <b>Cmd<\/b> (Mac) oder <b>Shift<\/b>.\n          <\/div>\n\n          <select id=\"keywordsMulti\" multiple><\/select>\n\n          <div class=\"filter-actions\">\n            <span id=\"applyFiltersRight\">Filter<\/span>\n            <span id=\"resetFiltersRight\">Zur\u00fccksetzen<\/span>\n          <\/div>\n        <\/div>\n      <\/div>\n    <\/div>\n  <\/div>\n\n  <div class=\"result-header\" id=\"resultCount\">Ergebnisse: 0<\/div>\n  <div id=\"dataDisplay\" class=\"hidden\"><\/div>\n\n  <script>\n    document.addEventListener(\"DOMContentLoaded\", function () {\n      const statusFilter = document.getElementById(\"statusFilter\");\n      const themenbereichFilter = document.getElementById(\"themenbereichFilter\");\n      const regionFilter = document.getElementById(\"regionFilter\");\n      const spracheFilter = document.getElementById(\"spracheFilter\");\n\n      const keywordsInput = document.getElementById(\"keywordsInput\");\n      const keywordsMulti = document.getElementById(\"keywordsMulti\");\n\n      const dataDisplay = document.getElementById(\"dataDisplay\");\n      const resultCount = document.getElementById(\"resultCount\");\n\n      const applyButtons = [\n        document.getElementById(\"applyFiltersLeft\"),\n        document.getElementById(\"applyFiltersRight\"),\n      ];\n      const resetButtons = [\n        document.getElementById(\"resetFiltersLeft\"),\n        document.getElementById(\"resetFiltersRight\"),\n      ];\n\n      let data = [];\n      let filteredData = [];\n\n      const COL = {\n        THEMENBEREICH: \"Themenbereich\",\n        TITEL: \"Titel\",\n        REGION: \"Region\",\n        ORGANISATION: \"Organisation\",\n        ZEITRAUM: \"Zeitraum\",\n        STATUS: \"Status\",\n        KEYWORDS: \"Keywords\",\n        INFO_TEXT: \"Information \/ Quelle\",\n        INFO_URL_CANDIDATES: [\"Information \/ Quelle_1\", \"Information \/ Quelle (2)\", \"Information \/ Quelle_2\"],\n        SPRACHE: \"Sprache\",\n      };\n\n      function normalizeStr(v) {\n        return (v ?? \"\").toString().trim();\n      }\n\n      function getInfoUrl(item) {\n        for (const k of COL.INFO_URL_CANDIDATES) {\n          if (item[k]) return normalizeStr(item[k]);\n        }\n        return \"\";\n      }\n\n      function safeUrl(url) {\n        const u = normalizeStr(url);\n        if (!u) return \"\";\n        return u.startsWith(\"http:\/\/\") || u.startsWith(\"https:\/\/\") ? u : (\"https:\/\/\" + u);\n      }\n\n      function buildOptions(values, { includeEmpty = true, multiple = false } = {}) {\n        const sorted = [...values].sort((a, b) => a.localeCompare(b, \"de\"));\n        const opts = sorted.map(v => {\n          const esc = v.replace(\/\"\/g, \"&quot;\");\n          return `<option value=\"${esc}\">${v}<\/option>`;\n        }).join(\"\");\n        if (!multiple && includeEmpty) {\n          return `<option value=\"\">- Ausw\u00e4hlen -<\/option>` + opts;\n        }\n        return opts;\n      }\n\n      function uniqueValues(key) {\n        return [...new Set(\n          data.map(item => normalizeStr(item[key]))\n              .filter(Boolean)\n        )];\n      }\n\n      function uniqueKeywordTokens() {\n        const tokens = new Set();\n        data.forEach(item => {\n          const kw = normalizeStr(item[COL.KEYWORDS]);\n          if (!kw) return;\n          kw.split(\",\").map(s => s.trim()).filter(Boolean).forEach(t => tokens.add(t));\n        });\n        return [...tokens];\n      }\n\n      function updateFilters() {\n        statusFilter.innerHTML = buildOptions(uniqueValues(COL.STATUS));\n        themenbereichFilter.innerHTML = buildOptions(uniqueValues(COL.THEMENBEREICH));\n        regionFilter.innerHTML = buildOptions(uniqueValues(COL.REGION));\n        spracheFilter.innerHTML = buildOptions(uniqueValues(COL.SPRACHE));\n\n        \/\/ multi-select keywords (no empty option)\n        keywordsMulti.innerHTML = buildOptions(uniqueKeywordTokens(), { includeEmpty: false, multiple: true });\n      }\n\n      function getSelectedMulti(selectEl) {\n        return Array.from(selectEl.selectedOptions).map(o => normalizeStr(o.value)).filter(Boolean);\n      }\n\n      function parseTypedKeywords(inputValue) {\n        const v = normalizeStr(inputValue);\n        if (!v) return [];\n        \/\/ allow comma or semicolon separated\n        return v.split(\/[,;]+\/).map(s => s.trim()).filter(Boolean);\n      }\n\n      function applyFilters() {\n        const selectedStatus = normalizeStr(statusFilter.value);\n        const selectedThemenbereich = normalizeStr(themenbereichFilter.value);\n        const selectedRegion = normalizeStr(regionFilter.value);\n        const selectedSprache = normalizeStr(spracheFilter.value);\n\n        const typedKeywords = parseTypedKeywords(keywordsInput.value);\n        const selectedKeywords = getSelectedMulti(keywordsMulti);\n\n        \/\/ combine both keyword sources\n        const keywordTokens = [...new Set([...typedKeywords, ...selectedKeywords])]\n          .map(k => k.toLowerCase());\n\n        const matchExact = (val, sel) => !sel || normalizeStr(val) === sel;\n\n        const keywordMatch = (item) => {\n          if (keywordTokens.length === 0) return true;\n          const kwCell = normalizeStr(item[COL.KEYWORDS]).toLowerCase();\n          if (!kwCell) return false;\n\n          \/\/ OR match: any token contained in the Keywords cell\n          return keywordTokens.some(t => kwCell.includes(t));\n        };\n\n        filteredData = data.filter(item => {\n          return (\n            matchExact(item[COL.STATUS], selectedStatus) &&\n            matchExact(item[COL.THEMENBEREICH], selectedThemenbereich) &&\n            matchExact(item[COL.REGION], selectedRegion) &&\n            matchExact(item[COL.SPRACHE], selectedSprache) &&\n            keywordMatch(item)\n          );\n        });\n\n        displayData();\n      }\n\n      function resetFilters() {\n        statusFilter.value = \"\";\n        themenbereichFilter.value = \"\";\n        regionFilter.value = \"\";\n        spracheFilter.value = \"\";\n\n        keywordsInput.value = \"\";\n        Array.from(keywordsMulti.options).forEach(o => o.selected = false);\n\n        applyFilters();\n      }\n\n      function renderRow(label, valueHtml) {\n        if (!valueHtml) return \"\";\n        return `<div class=\"project-row\"><strong>${label}<\/strong><span>${valueHtml}<\/span><\/div>`;\n      }\n\n      function displayData() {\n        dataDisplay.innerHTML = \"\";\n        resultCount.textContent = `Ergebnisse: ${filteredData.length}`;\n        dataDisplay.classList.toggle(\"hidden\", filteredData.length === 0);\n\n        filteredData.forEach(item => {\n          const title = normalizeStr(item[COL.TITEL]) || \"Kein Titel\";\n          const themenbereich = normalizeStr(item[COL.THEMENBEREICH]);\n          const region = normalizeStr(item[COL.REGION]);\n          const organisation = normalizeStr(item[COL.ORGANISATION]);\n          const zeitraum = normalizeStr(item[COL.ZEITRAUM]);\n          const status = normalizeStr(item[COL.STATUS]);\n          const keywords = normalizeStr(item[COL.KEYWORDS]);\n          const sprache = normalizeStr(item[COL.SPRACHE]);\n\n          const infoText = normalizeStr(item[COL.INFO_TEXT]);\n          const infoUrl = safeUrl(getInfoUrl(item));\n\n          const infoHtml = infoUrl\n            ? `<a href=\"${infoUrl}\" target=\"_blank\" rel=\"noopener noreferrer\">${infoText || infoUrl}<\/a>`\n            : (infoText || \"\");\n\n          const div = document.createElement(\"div\");\n          div.className = \"project-card\";\n          div.innerHTML = `\n            <div class=\"project-header\">${title}<\/div>\n            <div class=\"project-body\">\n              ${renderRow(\"Themenbereich:\", themenbereich)}\n              ${renderRow(\"Region:\", region)}\n              ${renderRow(\"Organisation:\", organisation)}\n              ${renderRow(\"Zeitraum:\", zeitraum)}\n              ${renderRow(\"Status:\", `<span class=\"${status.toLowerCase() === \"aktiv\" ? \"status-aktiv\" : \"\"}\">${status}<\/span>`)}\n              ${renderRow(\"Keywords:\", keywords)}\n              ${renderRow(\"Information \/ Quelle:\", infoHtml)}\n              ${renderRow(\"Sprache:\", sprache)}\n            <\/div>\n          `;\n          dataDisplay.appendChild(div);\n        });\n      }\n\n      \/\/ Buttons\n      applyButtons.forEach(btn => btn.addEventListener(\"click\", applyFilters));\n      resetButtons.forEach(btn => btn.addEventListener(\"click\", resetFilters));\n\n      \/\/ Auto-apply on dropdown change (left side)\n      [statusFilter, themenbereichFilter, regionFilter, spracheFilter].forEach(sel =>\n        sel.addEventListener(\"change\", applyFilters)\n      );\n\n      \/\/ Auto-apply when keywords multi-select changes\n      keywordsMulti.addEventListener(\"change\", applyFilters);\n\n      \/\/ Enter in keyword input triggers filter\n      keywordsInput.addEventListener(\"keydown\", (e) => {\n        if (e.key === \"Enter\") applyFilters();\n      });\n\n      \/\/ Load Excel\n      fetch(\"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-content\/uploads\/sites\/64\/2026\/03\/Excel-Filter-Projets_DE.xlsx\")\n        .then(r => r.blob())\n        .then(blob => {\n          const reader = new FileReader();\n          reader.onload = e => {\n            const workbook = XLSX.read(new Uint8Array(e.target.result), { type: \"array\" });\n            const sheet = workbook.Sheets[workbook.SheetNames[0]];\n\n            data = XLSX.utils.sheet_to_json(sheet, { defval: \"\" });\n\n            \/\/ Detect duplicate \"Information \/ Quelle\" headers if XLSX renamed them\n            const headers = Object.keys(data[0] || {});\n            const infoCols = headers.filter(h => h.startsWith(\"Information \/ Quelle\"));\n            if (infoCols.length >= 2) {\n              COL.INFO_URL_CANDIDATES = infoCols.slice(1);\n            }\n\n            updateFilters();\n            filteredData = data;\n            displayData();\n          };\n          reader.readAsArrayBuffer(blob);\n        })\n        .catch(err => {\n          console.error(err);\n          resultCount.textContent = \"Fehler beim Laden der Excel-Datei.\";\n        });\n    });\n  <\/script>\n<\/body>\n<\/html>\n<style class=\"advgb-styles-renderer\">\n    body { font-family: Arial, sans-serif; background-color: #ffffff; padding: 20px; }\n\n    .filter-box { background-color: #dff2fa; border-radius: 8px; margin-bottom: 20px; overflow: hidden; }\n    .filter-header { background-color: #008bcc; color: white; padding: 10px 15px; font-weight: bold; font-size: 1.1em; border-radius: 8px 8px 0 0; }\n\n    .filter-body { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 20px; gap: 20px; }\n\n    .filter-left { flex: 1 1 300px; }\n    .filter-left label, .search-wrapper label { display: block; margin-bottom: 5px; font-weight: bold; }\n\n    .filter-left select {\n      width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;\n      margin-bottom: 15px; background: #fff;\n    }\n\n    .filter-right {\n      flex: 1 1 300px; display: flex; align-items: center; justify-content: center;\n      border-left: 2px solid #008bcc;\n    }\n\n    .search-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 0 20px; gap: 10px; }\n\n    .search-wrapper input {\n      width: 100%; max-width: 360px; padding: 8px; border: 1px solid #008bcc;\n      background: #e6f3fc; border-radius: 4px;\n    }\n\n    .search-wrapper select[multiple] {\n      width: 100%;\n      max-width: 360px;\n      padding: 8px;\n      border: 1px solid #008bcc;\n      background: #ffffff;\n      border-radius: 4px;\n      min-height: 180px;\n    }\n\n    .helper-text {\n      font-size: 0.9em;\n      color: #0b5f86;\n      max-width: 360px;\n      line-height: 1.2em;\n    }\n\n    .filter-actions { display: flex; justify-content: center; margin-top: 10px; font-weight: bold; gap: 20px; }\n    .filter-actions span { color: #008bcc; cursor: pointer; transition: color 0.3s; }\n    .filter-actions span:hover { color: #005b85; }\n\n    .result-header { margin: 20px 0; font-weight: bold; color: #333; }\n\n    .project-card { border: 1px solid #008bcc; border-radius: 8px; margin-bottom: 20px; overflow: hidden; }\n    .project-header { background-color: #008bcc; color: white; padding: 10px 15px; font-weight: bold; font-size: 1.1em; }\n    .project-body { background-color: #e6f6fc; padding: 15px; }\n\n    .project-row { display: flex; margin-bottom: 6px; gap: 10px; }\n    .project-row strong { width: 160px; flex-shrink: 0; display: inline-block; }\n\n    .status-aktiv { color: #00b050; font-weight: bold; }\n\n    a { color: #008bcc; text-decoration: underline; word-break: break-word; }\n\n    .hidden { display: none; }\n\n    @media (max-width: 768px) {\n      .filter-body { flex-direction: column; }\n      .filter-right { border-left: none; border-top: 2px solid #008bcc; padding-top: 20px; }\n    }\n  <\/style>","protected":false},"excerpt":{"rendered":"<p>Hier k\u00f6nnen Sie sich \u00fcber laufende und abgeschlossene Projekte zum Thema Wassermanagement in der Landwirtschaft informieren. Nutzen Sie daf\u00fcr den untenstehenden Filter. Wir freuen uns \u00fcber Ihre Informationen zu weiteren Projekten, welche Sie hier einreichen k\u00f6nnen. Auf der Klimaplattform der AGRIDEA sind die Projekte der Kantone unter anderem zum Thema Wasser und Bew\u00e4sserung aufgelistet (via [&hellip;]<\/p>\n","protected":false},"author":927,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_sb_is_suggestion_mode":false,"_sb_show_suggestion_boards":false,"_sb_show_comment_boards":false,"_sb_suggestion_history":"","_sb_update_block_changes":"","om_disable_all_campaigns":false,"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-1024","page","type-page","status-publish","hentry"],"coauthors":[{"link":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/author\/sar2\/","display_name":"sar2"}],"author_meta":{"author_link":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/author\/sar2\/","display_name":"sar2"},"relative_dates":{"created":"Posted 1\u00a0Jahr ago","modified":"Updated 2\u00a0Wochen ago"},"absolute_dates":{"created":"Posted on Dezember 16, 2024","modified":"Updated on M\u00e4rz 25, 2026"},"absolute_dates_time":{"created":"Posted on Dezember 16, 2024 13:53","modified":"Updated on M\u00e4rz 25, 2026 15:17"},"featured_img_caption":"","featured_img":false,"series_order":"","_links":{"self":[{"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/pages\/1024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/users\/927"}],"replies":[{"embeddable":true,"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/comments?post=1024"}],"version-history":[{"count":28,"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/pages\/1024\/revisions"}],"predecessor-version":[{"id":64076,"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/pages\/1024\/revisions\/64076"}],"wp:attachment":[{"href":"https:\/\/agripedia.ch\/forum-wasser-landwirtschaft\/wp-json\/wp\/v2\/media?parent=1024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}