{"id":46021,"date":"2026-03-17T22:30:09","date_gmt":"2026-03-17T21:30:09","guid":{"rendered":"https:\/\/www.filmtheaterfanfare.nl\/site\/?page_id=46021"},"modified":"2026-03-24T15:47:25","modified_gmt":"2026-03-24T14:47:25","slug":"zoekcentrum","status":"publish","type":"page","link":"https:\/\/www.filmtheaterfanfare.nl\/site\/zoekcentrum\/","title":{"rendered":"Zoekcentrum"},"content":{"rendered":"<div class=\"ftfn-zoeker\">\n\n    <!-- Header-kader: titel + uitleg + zoekvak + radiobuttons -->\n    <div class=\"ftfn-zoeker-kader\">\n\n        <div class=\"ftfn-zoeker-titel\">FILMZOEKER<\/div>\n\n        <p class=\"ftfn-zoeker-uitleg\">\n            Zoek naar films in ons archief. Kies eerst waarmee je wilt zoeken \u2014 op titel, regisseur, acteur of land van herkomst \u2014 en typ daarna je zoekterm. De resultaten verschijnen automatisch. Klik op de titel voor de complete filminfo. Zoek je films in een bepaald jaar? Gebruik dan de <strong><a href=\"https:\/\/www.filmtheaterfanfare.nl\/site\/filmarchief\/?jaar=2026\">Fanfarepoll<\/a><\/strong>.\n        <\/p>\n\n        <div class=\"ftfn-zoeker-invoer\">\n\n            <div class=\"ftfn-zoeker-vak\">\n                <input type=\"text\"\n                       id=\"ftfn-zoekterm\"\n                       placeholder=\"Zoek een titel...\"\n                       autocomplete=\"off\"\n                       maxlength=\"100\">\n                <button type=\"button\" id=\"ftfn-wis\" title=\"Wissen\">&#x2715;<\/button>\n            <\/div>\n\n            <div class=\"ftfn-zoeker-radio\">\n                <label><input type=\"radio\" name=\"ftfn-type\" value=\"titel\" checked> Titel<\/label>\n                <label><input type=\"radio\" name=\"ftfn-type\" value=\"regisseur\"> Regisseur<\/label>\n                <label><input type=\"radio\" name=\"ftfn-type\" value=\"acteur\"> Acteur<\/label>\n                <label><input type=\"radio\" name=\"ftfn-type\" value=\"land\"> Land van herkomst<\/label>\n            <\/div>\n\n        <\/div>\n\n        <div id=\"ftfn-zoeker-count\" class=\"ftfn-zoeker-count\"><\/div>\n\n    <\/div>\n\n    <!-- Resultaten-kader: verschijnt zodra er resultaten zijn -->\n    <div id=\"ftfn-resultaten\"><\/div>\n\n<\/div>\n\n<script>\n(function(){\n    const ajaxurl    = \"https:\\\/\\\/www.filmtheaterfanfare.nl\\\/site\\\/wp-admin\\\/admin-ajax.php\";\n    const nonce      = \"eceb285a3f\";\n    const invoer     = document.getElementById('ftfn-zoekterm');\n    const resultaten = document.getElementById('ftfn-resultaten');\n    const countEl    = document.getElementById('ftfn-zoeker-count');\n    const wisBtn     = document.getElementById('ftfn-wis');\n\n    \/\/ Wis-knop tonen\/verbergen\n    invoer.addEventListener('input', function() {\n        wisBtn.style.display = this.value.length > 0 ? 'block' : 'none';\n    });\n    wisBtn.addEventListener('click', function() {\n        invoer.value = '';\n        wisBtn.style.display = 'none';\n        leegKader();\n        invoer.focus();\n    });\n\n    const placeholders = {\n        titel:      'Zoek een titel...',\n        regisseur:  'Zoek een regisseur...',\n        acteur:     'Zoek een acteur...',\n        land:       'Zoek een land van herkomst...'\n    };\n\n    let timer;\n\n    \/\/ Placeholder wisselen bij radiobutton\n    document.querySelectorAll('input[name=\"ftfn-type\"]').forEach(function(radio) {\n        radio.addEventListener('change', function() {\n            invoer.placeholder = placeholders[this.value] || '';\n            if (invoer.value.trim().length >= 3) zoek();\n            else leegKader();\n        });\n    });\n\n    function getType() {\n        const checked = document.querySelector('input[name=\"ftfn-type\"]:checked');\n        return checked ? checked.value : 'titel';\n    }\n\n    function toonInKader(html) {\n        resultaten.className = 'ftfn-zoeker-resultaten-kader';\n        resultaten.innerHTML = html;\n    }\n\n    function leegKader() {\n        resultaten.className = '';\n        resultaten.innerHTML = '';\n        countEl.innerHTML = '';\n    }\n\n    function zoek() {\n        const term = invoer.value.trim();\n        if (term.length < 3) {\n            countEl.innerHTML = '';\n            toonInKader('<p class=\"ftfn-zoeker-melding\">Voer minimaal 3 tekens in.<\/p>');\n            return;\n        }\n\n        countEl.innerHTML = '';\n        toonInKader('<p class=\"ftfn-zoeker-melding\"><span class=\"ftfn-spinner\"><\/span> Zoeken...<\/p>');\n\n        const data = new FormData();\n        data.append('action', 'ftfn_zoek');\n        data.append('nonce',  nonce);\n        data.append('term',   term);\n        data.append('type',   getType());\n\n        fetch(ajaxurl, { method: 'POST', body: data })\n            .then(function(r) { return r.json(); })\n            .then(function(json) {\n                countEl.innerHTML = json.count_text || '';\n                if (json.html) {\n                    toonInKader(json.html);\n                } else {\n                    resultaten.className = '';\n                    resultaten.innerHTML = '';\n                }\n            })\n            .catch(function() {\n                toonInKader('<p class=\"ftfn-zoeker-melding\">Er ging iets mis. Probeer opnieuw.<\/p>');\n            });\n    }\n\n    \/\/ Debounce bij typen\n    invoer.addEventListener('input', function() {\n        clearTimeout(timer);\n        if (this.value.trim().length >= 3)\n            timer = setTimeout(zoek, 400);\n        else\n            leegKader();\n    });\n\n    \/\/ Enter\n    invoer.addEventListener('keydown', function(e) {\n        if (e.key === 'Enter') { clearTimeout(timer); zoek(); }\n    });\n\n})();\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":45,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-46021","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/pages\/46021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/comments?post=46021"}],"version-history":[{"count":3,"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/pages\/46021\/revisions"}],"predecessor-version":[{"id":46123,"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/pages\/46021\/revisions\/46123"}],"wp:attachment":[{"href":"https:\/\/www.filmtheaterfanfare.nl\/site\/wp-json\/wp\/v2\/media?parent=46021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}