{"id":2555,"date":"2022-04-06T20:10:13","date_gmt":"2022-04-06T18:10:13","guid":{"rendered":"https:\/\/ekiwi.de\/?p=2555"},"modified":"2022-04-06T20:10:13","modified_gmt":"2022-04-06T18:10:13","slug":"real-cookie-banner-divs-mit-id-blockieren","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/index.php\/2555\/real-cookie-banner-divs-mit-id-blockieren\/","title":{"rendered":"Real Cookie Banner &#8211; divs mit id blockieren"},"content":{"rendered":"<p>Eine kurze Anleitung zum Blockieren von DIV-Elementen mit ID mit <a href=\"https:\/\/devowl.io\/de\/wordpress-real-cookie-banner\/\" target=\"_blank\" rel=\"noopener\">Real Cookie Banner<\/a>.<\/p>\n<p><!--more--><\/p>\n<p>Blockieren von externen Scripten geht mit dem Real Cookie Banner recht leicht durch die Erstellung eines Content-Blockers. Im Beispiel wollen wir ein DIV in der Seitenleiste ausblenden. Dieses k\u00f6nnte z.B. ein extern gehostetes Script enthalten, welches nur nach Zustimmung geladen wird.<\/p>\n<p>Unser DIV:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/04\/block_1.png\" alt=\"\" width=\"1017\" height=\"617\" class=\"alignnone size-full wp-image-2556\" srcset=\"\/wp-content\/uploads\/2022\/04\/block_1.png 1017w, \/wp-content\/uploads\/2022\/04\/block_1-300x182.png 300w, \/wp-content\/uploads\/2022\/04\/block_1-768x466.png 768w\" sizes=\"auto, (max-width: 1017px) 100vw, 1017px\" \/><\/p>\n<p>Das &#8222;div&#8220; bekommt die ID &#8222;contentBlock&#8220;. Den Namen k\u00f6nnen wir frei vergeben. Anhand diesen blockieren wir das Element.<\/p>\n<p>Anschlie\u00dfend f\u00fcgen wir einen individuellen &#8222;Content Blocker&#8220; hinzu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/04\/block_2.png\" alt=\"\" width=\"603\" height=\"365\" class=\"alignnone size-full wp-image-2557\" srcset=\"\/wp-content\/uploads\/2022\/04\/block_2.png 603w, \/wp-content\/uploads\/2022\/04\/block_2-300x182.png 300w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/p>\n<p>Als blockierendes Element geben wir <code>div[id=\"contentBlock\"]<\/code> ein. Dies ist der Name unseres DIVs.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/04\/block_3.png\" alt=\"\" width=\"470\" height=\"209\" class=\"alignnone size-full wp-image-2558\" srcset=\"\/wp-content\/uploads\/2022\/04\/block_3.png 470w, \/wp-content\/uploads\/2022\/04\/block_3-300x133.png 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/p>\n<p>Sofern noch nicht geschehen, m\u00fcssen wir f\u00fcr den Content Blocker noch einen Service hinzuf\u00fcgen.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/04\/block_4.png\" alt=\"\" width=\"679\" height=\"406\" class=\"alignnone size-full wp-image-2559\" srcset=\"\/wp-content\/uploads\/2022\/04\/block_4.png 679w, \/wp-content\/uploads\/2022\/04\/block_4-300x179.png 300w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" \/><\/p>\n<p>Fertig! Sofern der Nutzer dem Service zustimmt, wird das &#8222;div&#8220; direkt geladen. Falls nicht, erscheint der Content Blocker und der Benutzer kann das Element manuell frei schalten.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/04\/block_5.png\" alt=\"\" width=\"353\" height=\"605\" class=\"alignnone size-full wp-image-2560\" srcset=\"\/wp-content\/uploads\/2022\/04\/block_5.png 353w, \/wp-content\/uploads\/2022\/04\/block_5-175x300.png 175w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Eine kurze Anleitung zum Blockieren von DIV-Elementen mit ID mit Real Cookie Banner.<\/p>\n","protected":false},"author":1,"featured_media":2416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[5],"tags":[207],"class_list":["post-2555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hmtl","tag-cookie"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/2555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/comments?post=2555"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/2555\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media\/2416"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media?parent=2555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/categories?post=2555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/tags?post=2555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}