From 34efb2c6295a6867adf5a46150e96eea3e9f8efc Mon Sep 17 00:00:00 2001 From: Lucas Orth Date: Mon, 21 Sep 2026 20:23:19 +0200 Subject: [PATCH] Mu-Plugin 1.1: Eingabebox, Elementor-Widgets FAQ und Kurzantwort; normaler Beitragsinhalt --- README.md | 34 +- build/gen_wf2.py | 2 +- wordpress/skrift-ratgeber-felder.php | 568 ++++++++++++++++++++++--- workflows/pruefen-und-importieren.json | 132 +++--- 4 files changed, 608 insertions(+), 128 deletions(-) diff --git a/README.md b/README.md index be24f6c..dea7e19 100644 --- a/README.md +++ b/README.md @@ -183,21 +183,31 @@ Fehlt `seo_titel`, wird `titel` verwendet. ### Ausgabeform in WordPress -Der Node **Konfiguration** hat den Schalter `elementor_ausgabe`. +Der Artikel landet als normaler WordPress-Beitragsinhalt, nicht als +Elementor-Layout. Kurzantwort, FAQ, CTA-Ziel und Stand liegen als Meta-Felder +am Beitrag. -Steht er auf `true` (Standard), baut der Workflow aus dem Artikel eine -Elementor-Struktur: Der Text wird an den H2-Grenzen in einzelne -Text-Editor-Widgets zerlegt, die Kurzantwort bekommt einen eigenen Block, und -das FAQ wird zu einem **nested-accordion** mit aktiviertem `faq_schema`. -Das ist dasselbe Widget, das die Leistungsseiten von skrift.de verwenden, der -Beitrag laesst sich also im Builder wie jede andere Seite bearbeiten und -WordPress gibt automatisch FAQPage-Schema aus. +Das Mu-Plugin `skrift-ratgeber-felder.php` (ab Version 1.1) bringt dafuer mit: -Steht er auf `false`, landet der Artikel als klassischer Beitragsinhalt. Das FAQ -gibt dann der Shortcode `[skrift_faq]` aus, den das Mu-Plugin mitbringt. +- **Eingabebox "Ratgeber: Kurzantwort, CTA und FAQ"** unter dem Editor. + Dort lassen sich alle vier Felder von Hand pflegen, das FAQ als Liste mit + "Frage hinzufuegen". Speichern aus n8n per REST beruehrt die Box nicht. +- **Elementor-Widget "Skrift FAQ"**. Einmal ins Single-Post-Template im + Theme Builder setzen, dann zeigt jeder Beitrag automatisch seine eigenen + Fragen als Umschalter. Gestaltung (Typografie, Farben, Rahmen, Abstaende) + im Widget, FAQPage-Schema per Schalter. Beitraege ohne FAQ zeigen nichts an. +- **Elementor-Widget "Skrift Kurzantwort"** fuer die Kurzantwort-Box, + loest Preis-Shortcodes im Text auf. +- Shortcodes `[skrift_faq titel="..."]` und `[skrift_kurzantwort]` als + Alternative, etwa im Elementor-Shortcode-Widget. +- `cta_ziel` und `stand_datum` gibt Elementor Pro direkt ueber das Dynamic Tag + "Beitrags-Custom-Feld" aus. -Die Meta-Felder `kurzantwort`, `faq`, `cta_ziel` und `stand_datum` werden in -beiden Faellen geschrieben, unabhaengig von der Darstellung. +Das native Elementor-Widget "Akkordeon" kann keine Liste aus einem Meta-Feld +wiederholen, die Anzahl seiner Eintraege ist fest. Deshalb das eigene Widget. + +Der Schalter `elementor_ausgabe` im Node **Konfiguration** steht auf `false` +und sollte dort bleiben. ### Schreibregeln fuer content_html diff --git a/build/gen_wf2.py b/build/gen_wf2.py index 0a2c3f0..c0aca9b 100644 --- a/build/gen_wf2.py +++ b/build/gen_wf2.py @@ -68,7 +68,7 @@ KONF = node("Konfiguration", "n8n-nodes-base.set", 3.4, [-240, 190], { {"id": nid(), "name": "wp_base", "value": "https://skrift.de", "type": "string"}, {"id": nid(), "name": "score_ziel", "value": "={{ $json.body && $json.body.score_ziel ? Number($json.body.score_ziel) : 72 }}", "type": "number"}, {"id": nid(), "name": "pause_zwischen_artikeln", "value": 5, "type": "number"}, - {"id": nid(), "name": "elementor_ausgabe", "value": True, "type": "boolean"}, + {"id": nid(), "name": "elementor_ausgabe", "value": False, "type": "boolean"}, {"id": nid(), "name": "faq_ueberschrift", "value": "Häufige Fragen", "type": "string"}, {"id": nid(), "name": "benachrichtigung_an", "value": "privat@lucas-orth.de", "type": "string"}, ]}, "options": {}}) diff --git a/wordpress/skrift-ratgeber-felder.php b/wordpress/skrift-ratgeber-felder.php index bb9a516..57a127e 100644 --- a/wordpress/skrift-ratgeber-felder.php +++ b/wordpress/skrift-ratgeber-felder.php @@ -1,66 +1,51 @@ 'string', 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => 'wp_kses_post', 'auth_callback' => 'skrift_ratgeber_meta_auth', - 'description' => 'Kurzantwort auf die Hauptfrage des Artikels', ) ); - // Ziel des Call-to-Action, als URL. register_post_meta( 'post', 'cta_ziel', array( 'type' => 'string', 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => 'esc_url_raw', 'auth_callback' => 'skrift_ratgeber_meta_auth', - 'description' => 'Zieladresse des Call-to-Action', ) ); - // Stand des Artikels als ISO-Datum (YYYY-MM-DD). register_post_meta( 'post', 'stand_datum', array( 'type' => 'string', 'single' => true, 'show_in_rest' => true, - 'sanitize_callback' => function ( $wert ) { - return preg_match( '/^\d{4}-\d{2}-\d{2}$/', (string) $wert ) ? $wert : ''; - }, + 'sanitize_callback' => 'skrift_ratgeber_datum', 'auth_callback' => 'skrift_ratgeber_meta_auth', - 'description' => 'Stand des Artikels, Format YYYY-MM-DD', ) ); - /** - * FAQ als wiederholbare Gruppe. - * WordPress braucht fuer verschachtelte Werte ein explizites Schema, - * sonst lehnt die REST-API das Schreiben ab. - */ register_post_meta( 'post', 'faq', array( 'type' => 'array', 'single' => true, @@ -79,45 +64,530 @@ add_action( 'init', function () { ), ), 'auth_callback' => 'skrift_ratgeber_meta_auth', - 'description' => 'Liste aus Frage-Antwort-Paaren', ) ); } ); -/** - * Ausgabe der FAQ im Beitrag. - * Verwendung im Elementor-Shortcode-Widget: [skrift_faq] - * Optional mit Ueberschrift: [skrift_faq titel="Haeufige Fragen"] - */ -add_shortcode( 'skrift_faq', function ( $atts ) { - $atts = shortcode_atts( array( - 'titel' => '', - 'post_id' => 0, - ), $atts, 'skrift_faq' ); +function skrift_ratgeber_datum( $wert ) { + return preg_match( '/^\d{4}-\d{2}-\d{2}$/', (string) $wert ) ? $wert : ''; +} - $post_id = $atts['post_id'] ? (int) $atts['post_id'] : get_the_ID(); - $faq = get_post_meta( $post_id, 'faq', true ); +/* ------------------------------------------------------------------------ + * 2. Eingabebox im Beitragseditor (Gutenberg und klassisch) + * --------------------------------------------------------------------- */ - if ( empty( $faq ) || ! is_array( $faq ) ) { - return ''; +add_action( 'add_meta_boxes_post', function () { + add_meta_box( + 'skrift_ratgeber', + 'Ratgeber: Kurzantwort, CTA und FAQ', + 'skrift_ratgeber_metabox', + 'post', + 'normal', + 'high' + ); +} ); + +function skrift_ratgeber_metabox( $post ) { + wp_nonce_field( 'skrift_ratgeber_speichern', 'skrift_ratgeber_nonce' ); + + $kurz = (string) get_post_meta( $post->ID, 'kurzantwort', true ); + $cta = (string) get_post_meta( $post->ID, 'cta_ziel', true ); + $stand = (string) get_post_meta( $post->ID, 'stand_datum', true ); + $faq = get_post_meta( $post->ID, 'faq', true ); + if ( ! is_array( $faq ) ) { + $faq = array(); + } + ?> + +
+

+ + + Zwei bis drei Saetze, Preise nur per [skrift_preis key="..."]. +

+
+

+ + +

+

+ + +

+
+ + +
+ $e ) : ?> + + +
+ + + Leere Fragen werden beim Speichern entfernt. +
+ + +
+ + + Frage entfernen +
+ '; + update_post_meta( $post_id, 'kurzantwort', wp_kses_post( wp_unslash( $_POST['skrift_kurzantwort'] ?? '' ) ) ); + update_post_meta( $post_id, 'cta_ziel', esc_url_raw( wp_unslash( $_POST['skrift_cta_ziel'] ?? '' ) ) ); + update_post_meta( $post_id, 'stand_datum', skrift_ratgeber_datum( sanitize_text_field( wp_unslash( $_POST['skrift_stand_datum'] ?? '' ) ) ) ); - if ( $atts['titel'] ) { - $html .= '

' . esc_html( $atts['titel'] ) . '

'; - } - - foreach ( $faq as $eintrag ) { - if ( empty( $eintrag['frage'] ) ) { + $faq = array(); + $roh = isset( $_POST['skrift_faq'] ) && is_array( $_POST['skrift_faq'] ) ? wp_unslash( $_POST['skrift_faq'] ) : array(); + foreach ( $roh as $e ) { + $frage = sanitize_text_field( $e['frage'] ?? '' ); + if ( '' === $frage ) { continue; } - $html .= '
'; - $html .= '' . esc_html( $eintrag['frage'] ) . ''; - $html .= '
' . wp_kses_post( wpautop( $eintrag['antwort'] ?? '' ) ) . '
'; + $faq[] = array( + 'frage' => $frage, + 'antwort' => wp_kses_post( $e['antwort'] ?? '' ), + ); + } + update_post_meta( $post_id, 'faq', $faq ); +} ); + +/* ------------------------------------------------------------------------ + * 3. Ausgabe: gemeinsamer Renderer fuer Shortcode und Elementor-Widget + * --------------------------------------------------------------------- */ + +function skrift_faq_eintraege( $post_id = 0 ) { + $post_id = $post_id ? (int) $post_id : get_the_ID(); + $faq = get_post_meta( $post_id, 'faq', true ); + if ( ! is_array( $faq ) ) { + return array(); + } + $raus = array(); + foreach ( $faq as $e ) { + if ( ! empty( $e['frage'] ) ) { + $raus[] = $e; + } + } + return $raus; +} + +function skrift_faq_basis_css() { + static $fertig = false; + if ( $fertig ) { + return ''; + } + $fertig = true; + return ''; +} + +function skrift_faq_schema( $faq ) { + $fragen = array(); + foreach ( $faq as $e ) { + $fragen[] = array( + '@type' => 'Question', + 'name' => wp_strip_all_tags( $e['frage'] ), + 'acceptedAnswer' => array( + '@type' => 'Answer', + 'text' => wp_strip_all_tags( do_shortcode( $e['antwort'] ?? '' ) ), + ), + ); + } + return ''; +} + +function skrift_faq_html( $faq, $args = array() ) { + $args = wp_parse_args( $args, array( + 'titel' => '', + 'titel_tag' => 'h2', + 'erste_offen' => false, + 'schema' => true, + ) ); + if ( empty( $faq ) ) { + return ''; + } + $tag = in_array( $args['titel_tag'], array( 'h2', 'h3', 'h4', 'div' ), true ) ? $args['titel_tag'] : 'h2'; + + $html = skrift_faq_basis_css() . '
'; + if ( '' !== $args['titel'] ) { + $html .= sprintf( '<%1$s class="skrift-faq__titel">%2$s', $tag, esc_html( $args['titel'] ) ); + } + foreach ( array_values( $faq ) as $i => $e ) { + $offen = ( $args['erste_offen'] && 0 === $i ) ? ' open' : ''; + $html .= '
'; + $html .= '' . esc_html( $e['frage'] ) . ''; + $html .= '
' . wp_kses_post( wpautop( do_shortcode( $e['antwort'] ?? '' ) ) ) . '
'; $html .= '
'; } - $html .= '
'; - + if ( $args['schema'] ) { + $html .= skrift_faq_schema( $faq ); + } return $html; +} + +function skrift_kurzantwort_html( $post_id = 0 ) { + $post_id = $post_id ? (int) $post_id : get_the_ID(); + $text = (string) get_post_meta( $post_id, 'kurzantwort', true ); + if ( '' === trim( $text ) ) { + return ''; + } + return '
' . wp_kses_post( wpautop( do_shortcode( $text ) ) ) . '
'; +} + +/* Shortcodes, z. B. fuer das Elementor-Shortcode-Widget oder klassische Themes */ + +add_shortcode( 'skrift_faq', function ( $atts ) { + $atts = shortcode_atts( array( + 'titel' => '', + 'erste_offen' => '0', + 'schema' => '1', + 'post_id' => 0, + ), $atts, 'skrift_faq' ); + return skrift_faq_html( skrift_faq_eintraege( $atts['post_id'] ), array( + 'titel' => $atts['titel'], + 'erste_offen' => '1' === (string) $atts['erste_offen'], + 'schema' => '1' === (string) $atts['schema'], + ) ); +} ); + +add_shortcode( 'skrift_kurzantwort', function ( $atts ) { + $atts = shortcode_atts( array( 'post_id' => 0 ), $atts, 'skrift_kurzantwort' ); + return skrift_kurzantwort_html( $atts['post_id'] ); +} ); + +/* ------------------------------------------------------------------------ + * 4. Elementor-Widgets: Skrift FAQ und Skrift Kurzantwort + * Einmal ins Single-Post-Template (Theme Builder) setzen, dann zeigt + * jeder Beitrag automatisch seine eigenen Fragen. + * --------------------------------------------------------------------- */ + +function skrift_elementor_bearbeitungsmodus() { + if ( ! class_exists( '\Elementor\Plugin' ) ) { + return false; + } + $e = \Elementor\Plugin::$instance; + if ( isset( $e->editor ) && $e->editor->is_edit_mode() ) { + return true; + } + return isset( $e->preview ) && $e->preview->is_preview_mode(); +} + +add_action( 'elementor/widgets/register', function ( $widgets_manager ) { + + if ( ! class_exists( '\Elementor\Widget_Base' ) ) { + return; + } + + if ( ! class_exists( 'Skrift_FAQ_Widget' ) ) { + + class Skrift_FAQ_Widget extends \Elementor\Widget_Base { + + public function get_name() { + return 'skrift_faq'; + } + + public function get_title() { + return 'Skrift FAQ'; + } + + public function get_icon() { + return 'eicon-accordion'; + } + + public function get_categories() { + return array( 'general' ); + } + + public function get_keywords() { + return array( 'faq', 'fragen', 'skrift', 'akkordeon', 'umschalter', 'toggle' ); + } + + protected function register_controls() { + $C = '\Elementor\Controls_Manager'; + + $this->start_controls_section( 'inhalt', array( 'label' => 'Inhalt' ) ); + $this->add_control( 'hinweis', array( + 'type' => $C::RAW_HTML, + 'raw' => 'Fragen und Antworten kommen aus dem Meta-Feld faq des jeweiligen Beitrags.', + ) ); + $this->add_control( 'titel', array( + 'label' => 'Ueberschrift', + 'type' => $C::TEXT, + 'default' => 'Häufige Fragen', + ) ); + $this->add_control( 'titel_tag', array( + 'label' => 'HTML-Tag der Ueberschrift', + 'type' => $C::SELECT, + 'default' => 'h2', + 'options' => array( 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'div' => 'div' ), + ) ); + $this->add_control( 'erste_offen', array( + 'label' => 'Erste Frage geoeffnet', + 'type' => $C::SWITCHER, + 'default' => '', + ) ); + $this->add_control( 'schema', array( + 'label' => 'FAQ-Schema ausgeben', + 'type' => $C::SWITCHER, + 'default' => 'yes', + ) ); + $this->end_controls_section(); + + $this->start_controls_section( 'stil_titel', array( 'label' => 'Ueberschrift', 'tab' => $C::TAB_STYLE ) ); + $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( + 'name' => 'titel_typo', + 'selector' => '{{WRAPPER}} .skrift-faq__titel', + ) ); + $this->add_control( 'titel_farbe', array( + 'label' => 'Farbe', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-faq__titel' => 'color: {{VALUE}};' ), + ) ); + $this->add_responsive_control( 'titel_abstand', array( + 'label' => 'Abstand darunter', + 'type' => $C::SLIDER, + 'size_units' => array( 'px', 'em' ), + 'selectors' => array( '{{WRAPPER}} .skrift-faq__titel' => 'margin-bottom: {{SIZE}}{{UNIT}};' ), + ) ); + $this->end_controls_section(); + + $this->start_controls_section( 'stil_frage', array( 'label' => 'Frage', 'tab' => $C::TAB_STYLE ) ); + $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( + 'name' => 'frage_typo', + 'selector' => '{{WRAPPER}} .skrift-faq__frage', + ) ); + $this->add_control( 'frage_farbe', array( + 'label' => 'Farbe', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-faq__frage' => 'color: {{VALUE}};' ), + ) ); + $this->add_control( 'frage_farbe_offen', array( + 'label' => 'Farbe geoeffnet', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-faq__eintrag[open] .skrift-faq__frage' => 'color: {{VALUE}};' ), + ) ); + $this->add_control( 'frage_hintergrund', array( + 'label' => 'Hintergrund', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-faq__frage' => 'background-color: {{VALUE}};' ), + ) ); + $this->add_responsive_control( 'frage_innenabstand', array( + 'label' => 'Innenabstand', + 'type' => $C::DIMENSIONS, + 'size_units' => array( 'px', 'em' ), + 'selectors' => array( '{{WRAPPER}} .skrift-faq__frage' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ), + ) ); + $this->end_controls_section(); + + $this->start_controls_section( 'stil_antwort', array( 'label' => 'Antwort', 'tab' => $C::TAB_STYLE ) ); + $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( + 'name' => 'antwort_typo', + 'selector' => '{{WRAPPER}} .skrift-faq__antwort', + ) ); + $this->add_control( 'antwort_farbe', array( + 'label' => 'Farbe', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-faq__antwort' => 'color: {{VALUE}};' ), + ) ); + $this->add_responsive_control( 'antwort_innenabstand', array( + 'label' => 'Innenabstand', + 'type' => $C::DIMENSIONS, + 'size_units' => array( 'px', 'em' ), + 'selectors' => array( '{{WRAPPER}} .skrift-faq__antwort' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ), + ) ); + $this->end_controls_section(); + + $this->start_controls_section( 'stil_eintrag', array( 'label' => 'Eintrag', 'tab' => $C::TAB_STYLE ) ); + $this->add_group_control( \Elementor\Group_Control_Border::get_type(), array( + 'name' => 'eintrag_rahmen', + 'selector' => '{{WRAPPER}} .skrift-faq__eintrag', + ) ); + $this->add_control( 'eintrag_radius', array( + 'label' => 'Eckenradius', + 'type' => $C::DIMENSIONS, + 'size_units' => array( 'px' ), + 'selectors' => array( '{{WRAPPER}} .skrift-faq__eintrag' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;' ), + ) ); + $this->add_control( 'eintrag_hintergrund', array( + 'label' => 'Hintergrund', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-faq__eintrag' => 'background-color: {{VALUE}};' ), + ) ); + $this->add_responsive_control( 'eintrag_abstand', array( + 'label' => 'Abstand zwischen Eintraegen', + 'type' => $C::SLIDER, + 'size_units' => array( 'px', 'em' ), + 'selectors' => array( '{{WRAPPER}} .skrift-faq__eintrag + .skrift-faq__eintrag' => 'margin-top: {{SIZE}}{{UNIT}};' ), + ) ); + $this->end_controls_section(); + } + + protected function render() { + $s = $this->get_settings_for_display(); + $faq = skrift_faq_eintraege(); + $bearbeiten = skrift_elementor_bearbeitungsmodus(); + + // Im Theme-Builder-Template gibt es keinen Beitrag mit FAQ, + // deshalb dort Platzhalter zum Gestalten. + if ( empty( $faq ) && $bearbeiten ) { + $faq = array( + array( 'frage' => 'Beispielfrage aus dem Feld faq', 'antwort' => 'Im Beitrag erscheinen hier die Antworten aus dem Meta-Feld faq.' ), + array( 'frage' => 'Zweite Beispielfrage', 'antwort' => 'Die Gestaltung legen Sie hier im Widget fest, sie gilt fuer alle Beitraege.' ), + array( 'frage' => 'Dritte Beispielfrage', 'antwort' => 'Beitraege ohne FAQ zeigen an dieser Stelle nichts an.' ), + ); + } + + echo skrift_faq_html( $faq, array( // phpcs:ignore WordPress.Security.EscapeOutput + 'titel' => (string) ( $s['titel'] ?? '' ), + 'titel_tag' => (string) ( $s['titel_tag'] ?? 'h2' ), + 'erste_offen' => 'yes' === ( $s['erste_offen'] ?? '' ), + 'schema' => 'yes' === ( $s['schema'] ?? '' ) && ! $bearbeiten, + ) ); + } + } + } + + if ( ! class_exists( 'Skrift_Kurzantwort_Widget' ) ) { + + class Skrift_Kurzantwort_Widget extends \Elementor\Widget_Base { + + public function get_name() { + return 'skrift_kurzantwort'; + } + + public function get_title() { + return 'Skrift Kurzantwort'; + } + + public function get_icon() { + return 'eicon-text'; + } + + public function get_categories() { + return array( 'general' ); + } + + public function get_keywords() { + return array( 'kurzantwort', 'skrift', 'zusammenfassung', 'box' ); + } + + protected function register_controls() { + $C = '\Elementor\Controls_Manager'; + + $this->start_controls_section( 'inhalt', array( 'label' => 'Inhalt' ) ); + $this->add_control( 'hinweis', array( + 'type' => $C::RAW_HTML, + 'raw' => 'Der Text kommt aus dem Meta-Feld kurzantwort. Preis-Shortcodes darin werden aufgeloest.', + ) ); + $this->end_controls_section(); + + $this->start_controls_section( 'stil_box', array( 'label' => 'Box', 'tab' => $C::TAB_STYLE ) ); + $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( + 'name' => 'box_typo', + 'selector' => '{{WRAPPER}} .skrift-kurzantwort', + ) ); + $this->add_control( 'box_farbe', array( + 'label' => 'Textfarbe', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-kurzantwort' => 'color: {{VALUE}};' ), + ) ); + $this->add_control( 'box_hintergrund', array( + 'label' => 'Hintergrund', + 'type' => $C::COLOR, + 'selectors' => array( '{{WRAPPER}} .skrift-kurzantwort' => 'background-color: {{VALUE}};' ), + ) ); + $this->add_group_control( \Elementor\Group_Control_Border::get_type(), array( + 'name' => 'box_rahmen', + 'selector' => '{{WRAPPER}} .skrift-kurzantwort', + ) ); + $this->add_control( 'box_radius', array( + 'label' => 'Eckenradius', + 'type' => $C::DIMENSIONS, + 'size_units' => array( 'px' ), + 'selectors' => array( '{{WRAPPER}} .skrift-kurzantwort' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ), + ) ); + $this->add_responsive_control( 'box_innenabstand', array( + 'label' => 'Innenabstand', + 'type' => $C::DIMENSIONS, + 'size_units' => array( 'px', 'em' ), + 'selectors' => array( '{{WRAPPER}} .skrift-kurzantwort' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ), + ) ); + $this->end_controls_section(); + } + + protected function render() { + $html = skrift_kurzantwort_html(); + if ( '' === $html && skrift_elementor_bearbeitungsmodus() ) { + $html = '

Platzhalter: Hier erscheint die Kurzantwort des jeweiligen Beitrags.

'; + } + echo $html; // phpcs:ignore WordPress.Security.EscapeOutput + } + } + } + + $widgets_manager->register( new Skrift_FAQ_Widget() ); + $widgets_manager->register( new Skrift_Kurzantwort_Widget() ); } ); diff --git a/workflows/pruefen-und-importieren.json b/workflows/pruefen-und-importieren.json index 078a2b9..c1df659 100644 --- a/workflows/pruefen-und-importieren.json +++ b/workflows/pruefen-und-importieren.json @@ -9,7 +9,7 @@ -460, 100 ], - "id": "91d71cf1-2650-4e1a-a053-9e01f04cb78a", + "id": "793c9880-e989-44d5-b514-d6850b64fd2e", "name": "Manuell starten" }, { @@ -25,9 +25,9 @@ -460, 280 ], - "id": "b8826586-3f30-40f9-9f4d-3566606a9b3a", + "id": "0bb95de2-96dd-4f8b-af1e-3bab20eca241", "name": "Webhook Start", - "webhookId": "7ed025cf-5099-4378-a2d2-51fd49e119af" + "webhookId": "53c83399-7059-4816-8f7c-c606015c02c0" }, { "parameters": { @@ -35,91 +35,91 @@ "assignments": { "assignments": [ { - "id": "4b4628e5-2614-49aa-a5af-7c7d8e0c6c07", + "id": "f161eded-c23e-4d60-9d8b-d4db483ec3d9", "name": "nw_base", "value": "https://app.neuronwriter.com/neuron-api/0.5/writer", "type": "string" }, { - "id": "664c1556-dec1-4d5d-9652-e891ebf08b26", + "id": "0544c6b7-e388-4bb4-b418-2dc97bc56bb6", "name": "gitea_base", "value": "http://gitea:3000", "type": "string" }, { - "id": "d8cfbc45-e4f2-4160-89db-a5400c808315", + "id": "46b15bb0-7e1a-48f5-addb-e8ca1a46491a", "name": "gitea_owner", "value": "lucas.orth", "type": "string" }, { - "id": "2ff01e0d-dbc6-403d-84d4-59ab22d9a08c", + "id": "46eb7849-83d0-4cd2-b978-6a49c4ddb31e", "name": "gitea_repo", "value": "Skrift-Auto-Article", "type": "string" }, { - "id": "d40df7d1-29ad-4a1b-b67f-4fa1715b9604", + "id": "84f7d295-04fa-4f95-b723-98f0dc1a042b", "name": "branch", "value": "main", "type": "string" }, { - "id": "181b4931-53cb-4b3d-93df-4fc681901e05", + "id": "1bd8cf46-e184-47c5-897a-aa4b4d08d591", "name": "artikel_ordner", "value": "artikel", "type": "string" }, { - "id": "f39283ce-c479-4566-aaab-4a2a1f58d802", + "id": "1c6a8050-c17c-4635-b371-cc5a40fda4e5", "name": "brief_ordner", "value": "briefe", "type": "string" }, { - "id": "f90a205e-fdc1-4079-bf9b-b4ee32663d00", + "id": "9eb50d4b-0ac5-4bd9-8733-fe1bcb82b601", "name": "nachbessern_ordner", "value": "nachbessern", "type": "string" }, { - "id": "6ff168b7-4cb4-42be-990d-7193915a81da", + "id": "91ec4a89-c907-403d-aaa4-77e074a85992", "name": "status_pfad", "value": "status-importe.json", "type": "string" }, { - "id": "9135d2b6-887e-4f75-b150-6c66bc83738b", + "id": "7e6d86e6-4195-4cdd-b3b2-1ee1fceb9805", "name": "wp_base", "value": "https://skrift.de", "type": "string" }, { - "id": "4350f279-2b06-4b2d-98c8-66318a09c399", + "id": "405fcf78-a5a0-4fb8-9f04-d8041906f2b3", "name": "score_ziel", "value": "={{ $json.body && $json.body.score_ziel ? Number($json.body.score_ziel) : 72 }}", "type": "number" }, { - "id": "0bd22beb-337c-4245-b702-182c6774474d", + "id": "4e9becf4-a380-407b-b4b9-b8b821e2992f", "name": "pause_zwischen_artikeln", "value": 5, "type": "number" }, { - "id": "2a18eec7-58de-43d0-a2c2-7e6c6961f27a", + "id": "11c7167c-f60e-47c6-9832-9ef0124628c2", "name": "elementor_ausgabe", - "value": true, + "value": false, "type": "boolean" }, { - "id": "24a9e76c-f761-439a-a8b4-97092dff1814", + "id": "0a4b7c2b-14f5-43cb-ae2a-64d30d58a1f4", "name": "faq_ueberschrift", "value": "Häufige Fragen", "type": "string" }, { - "id": "f75796f9-4e41-434e-812f-7edfd84cd248", + "id": "debc59ab-4e8e-44de-80c2-334c15fc55ac", "name": "benachrichtigung_an", "value": "privat@lucas-orth.de", "type": "string" @@ -134,7 +134,7 @@ -240, 190 ], - "id": "02d8abd1-fb76-472c-b763-a297cf9b3d9e", + "id": "86f2b355-8a1a-4336-b2c9-1a2cbb0aa6f1", "name": "Konfiguration" }, { @@ -159,7 +159,7 @@ -20, 190 ], - "id": "b4f7e1e9-dc21-4f98-9271-bba61b1b1d39", + "id": "144a0300-78e5-4f50-828c-0e0dc617947c", "name": "Artikelordner lesen", "credentials": { "httpHeaderAuth": { @@ -182,7 +182,7 @@ 200, 190 ], - "id": "70da53d6-0889-4d9e-8c79-268aeab7c55f", + "id": "03942d18-af94-439b-89a9-d9734d845f83", "name": "Artikeldateien filtern" }, { @@ -196,7 +196,7 @@ }, "conditions": [ { - "id": "d8907dfa-944b-4e3c-826b-04ea4aa3a690", + "id": "dd545030-181b-40c1-ba1c-563e93f9cdf9", "leftValue": "={{ $json.leer === true }}", "rightValue": "", "operator": { @@ -217,7 +217,7 @@ 420, 190 ], - "id": "cee6dd86-6638-4139-9cbe-a9b2f1c010db", + "id": "ac2420c7-c498-4e3e-a26e-542f7d585a35", "name": "Artikel vorhanden?" }, { @@ -228,7 +228,7 @@ 640, 40 ], - "id": "762e3de3-d0dc-4f7a-b33f-575329df610e", + "id": "1f77ee2a-d8e9-4bcf-9ac9-5f1c1772d5ac", "name": "Nichts zu tun" }, { @@ -244,7 +244,7 @@ 640, 320 ], - "id": "56d2a5ce-4069-4bb0-8fc7-9ea81aaecf1d", + "id": "11279052-fb96-4d7b-b03a-4a64b524ab30", "name": "Artikel nacheinander" }, { @@ -268,7 +268,7 @@ 900, 420 ], - "id": "cffa46f3-dcec-4165-bedc-c0258ff786d5", + "id": "d36af43a-e39d-4e20-9ef8-00101a0dfef5", "name": "Artikeldatei laden", "credentials": { "httpHeaderAuth": { @@ -292,7 +292,7 @@ 900, 640 ], - "id": "3ad8a166-e94f-40d0-97dc-c66efe7315cc", + "id": "49f78b05-7b28-4ca6-be18-fb0fb27cfcb9", "name": "Fehler Artikeldatei", "onError": "continueRegularOutput" }, @@ -318,7 +318,7 @@ 1120, 420 ], - "id": "7bcc8532-384b-4b80-bde5-5019b8b13067", + "id": "88ea6484-2c70-4e73-870f-404eb5d43676", "name": "Brief laden", "credentials": { "httpHeaderAuth": { @@ -338,7 +338,7 @@ 1340, 420 ], - "id": "573a808f-5d24-4aec-adc3-31b5c1710e2d", + "id": "d0f641c2-78a7-4b25-addb-05044edbed6e", "name": "Artikel pruefen" }, { @@ -368,7 +368,7 @@ 1560, 420 ], - "id": "ba5aeeaa-78b2-4cd4-9df1-eb5709214071", + "id": "a7eb667d-7eec-4a65-8d90-206084368755", "name": "Score ermitteln", "credentials": { "httpHeaderAuth": { @@ -392,7 +392,7 @@ 1560, 640 ], - "id": "98617eeb-9cca-416e-b31e-3f72118972d7", + "id": "902fc43d-9265-43ac-9c0b-a75a9c7da079", "name": "Fehler Score", "onError": "continueRegularOutput" }, @@ -407,7 +407,7 @@ 1780, 420 ], - "id": "bbb33e59-c2e0-4ace-9dd2-e1e75d9859bb", + "id": "8e45bb62-1738-4149-bd65-96b671fc3186", "name": "Score auswerten" }, { @@ -421,7 +421,7 @@ }, "conditions": [ { - "id": "160a4ec1-ada5-45fa-860e-77a612991f75", + "id": "b6a9240e-c1a2-4178-ae65-05534281a1a9", "leftValue": "={{ $json.bestanden }}", "rightValue": "", "operator": { @@ -442,7 +442,7 @@ 2000, 420 ], - "id": "83cba8ad-255b-4065-9bac-486c22473d2b", + "id": "d240d88f-009d-423b-a781-6fd6317f0c99", "name": "Score erreicht?" }, { @@ -456,7 +456,7 @@ 2220, 640 ], - "id": "7443696e-d930-428a-9016-a8157d1a3c6e", + "id": "3dfd0f0e-f104-44d2-a44b-3cd7705d4833", "name": "Fehlende Begriffe ermitteln" }, { @@ -481,7 +481,7 @@ 2440, 640 ], - "id": "4a19ef5f-785d-4d1b-a34b-95a56db54173", + "id": "2320c737-09a9-4d44-8e70-9be83b3d2008", "name": "Nachbesserung vorhanden?", "credentials": { "httpHeaderAuth": { @@ -501,7 +501,7 @@ 2660, 640 ], - "id": "8e776ef8-83c0-4252-b1df-0988dcac30df", + "id": "ce049aa8-6b87-4fd3-be30-ff5e9ae85e88", "name": "Nachbesserung vorbereiten" }, { @@ -531,7 +531,7 @@ 2880, 640 ], - "id": "eedf1218-7b12-4dc9-b36c-3cd1845aadc7", + "id": "e16e2245-e642-42f3-91e1-1149d52dd502", "name": "Nachbesserung committen", "credentials": { "httpHeaderAuth": { @@ -555,7 +555,7 @@ 2880, 860 ], - "id": "f2e2311e-23fe-4de3-825e-2520bea60aa6", + "id": "88172a57-71cf-4c76-a148-3e625df08e72", "name": "Fehler Nachbesserung", "onError": "continueRegularOutput" }, @@ -570,7 +570,7 @@ 3100, 640 ], - "id": "e73f8277-d65b-4ae0-8632-38cca861107f", + "id": "3d34a3d6-1ce3-41a2-aa66-b9e5d9065708", "name": "Nachbesserung gemerkt" }, { @@ -600,7 +600,7 @@ 2220, 240 ], - "id": "7b29edb4-7203-4272-8294-28bc65b91b43", + "id": "8bd24b62-3161-4596-9dc0-9c73a434ffe8", "name": "Revision zu NeuronWriter", "credentials": { "httpHeaderAuth": { @@ -624,7 +624,7 @@ 2220, 60 ], - "id": "de95f5b3-cb3e-4bb4-91d0-3ce9c431e3f8", + "id": "295a6ba5-75f4-4807-8090-23720da69936", "name": "Fehler Revision", "onError": "continueRegularOutput" }, @@ -650,7 +650,7 @@ 2440, 240 ], - "id": "95d79724-0654-4883-bb8a-879293613b5c", + "id": "01befefc-e4ef-48a5-943f-6aa732736c99", "name": "Beitrag vorhanden?", "credentials": { "httpBasicAuth": { @@ -684,7 +684,7 @@ 2660, 240 ], - "id": "2965f100-55d5-4a5c-b320-ae4d63906c5a", + "id": "70e77372-0d3f-4c68-815b-ddb13d7f18e8", "name": "Kategorie suchen", "credentials": { "httpBasicAuth": { @@ -707,7 +707,7 @@ 2880, 240 ], - "id": "09fa5259-508e-466d-9125-8f4d130beb63", + "id": "a0b6cc70-8253-4317-af8c-52da2a11d384", "name": "Kategorie pruefen" }, { @@ -721,7 +721,7 @@ }, "conditions": [ { - "id": "a20d73bb-35db-4ecf-82d0-b62020fb9f94", + "id": "88bdb3bb-b27e-4f62-a3e3-81ff95173268", "leftValue": "={{ $json.kategorie_fehlt }}", "rightValue": "", "operator": { @@ -742,7 +742,7 @@ 3100, 240 ], - "id": "923b0aac-5ca7-492b-a5c9-391acdce69d4", + "id": "fd48f6d4-961a-4219-a245-55582aefbbce", "name": "Kategorie anlegen?" }, { @@ -772,7 +772,7 @@ 3320, 140 ], - "id": "fcdb245e-5788-4cb7-878c-98bfa4dd2db4", + "id": "4a56f882-d5f3-463c-aaa3-c94414f8c214", "name": "Kategorie anlegen", "credentials": { "httpBasicAuth": { @@ -795,7 +795,7 @@ 3540, 240 ], - "id": "09202e3f-4ace-4a1b-9eca-cb4b9ce3c3e4", + "id": "4f8157e0-d898-49dd-a112-863e63ffa550", "name": "Kategorie festlegen" }, { @@ -809,7 +809,7 @@ 3760, 240 ], - "id": "2fb8e360-a7b5-409c-8688-5aa04851cc75", + "id": "fdb757fc-b0bc-4def-8a93-0e679a669b9e", "name": "WordPress-Body bauen" }, { @@ -839,7 +839,7 @@ 3980, 240 ], - "id": "614cf4f3-11a5-44c0-9342-ed36827cd5f0", + "id": "af5dc8ab-bcae-4b0c-975e-e7535ab616f4", "name": "Beitrag anlegen oder aktualisieren", "credentials": { "httpBasicAuth": { @@ -862,7 +862,7 @@ 4200, 240 ], - "id": "3ad3d285-d1cf-4dc0-a2e2-bf3f95fd4c34", + "id": "d1513f84-dd96-41dd-981d-068eb0e015bb", "name": "Ergebnis pruefen" }, { @@ -893,7 +893,7 @@ 4420, 240 ], - "id": "a7caa3d3-a44b-4d3f-9d74-895ad99e8f5d", + "id": "3039ffe1-f6a5-43e7-bd80-a7818a75f458", "name": "Cache leeren", "credentials": { "httpBasicAuth": { @@ -913,7 +913,7 @@ 4640, 240 ], - "id": "7b8662eb-1bf1-464f-a153-976c4bafb905", + "id": "061fc5f3-7a21-4dc0-87bb-e1c789ca31fc", "name": "Importergebnis merken" }, { @@ -927,9 +927,9 @@ 4860, 420 ], - "id": "e1588d91-d590-4092-b17b-62a0f4bd091d", + "id": "92a3b5c9-ffb9-4db8-90b0-664c7a252f55", "name": "Pause Rate Limit", - "webhookId": "c135194f-02f6-4034-a27a-80412f32e2d8" + "webhookId": "6c1f5f05-129e-4a6f-88c2-18d3580177ac" }, { "parameters": { @@ -942,7 +942,7 @@ 900, 80 ], - "id": "c3906d3f-17c2-44c4-ae4a-1fded6ecb063", + "id": "b5e9fe9f-14ec-4ceb-9e90-dfc7a2157e04", "name": "Ergebnisse sammeln" }, { @@ -967,7 +967,7 @@ 1120, 80 ], - "id": "65f716cc-6b5f-49fe-870c-43333ae12de6", + "id": "0e50466e-1a53-4df6-9e69-6de44bc287a6", "name": "Statustabelle lesen", "credentials": { "httpHeaderAuth": { @@ -987,7 +987,7 @@ 1340, 80 ], - "id": "26726765-3fb4-4a97-bd5f-b54e1b2acbcd", + "id": "d1ff39f4-f404-4857-bb5d-43261f32299e", "name": "Statustabelle fortschreiben" }, { @@ -1001,7 +1001,7 @@ }, "conditions": [ { - "id": "85e7ddc2-927d-4ffb-a25e-4da81fec7e0a", + "id": "95cee571-76cd-4c6b-bdff-cbee60c28afc", "leftValue": "={{ $json.ueberspringen }}", "rightValue": "", "operator": { @@ -1022,7 +1022,7 @@ 1560, 80 ], - "id": "9a6ec416-dd7c-4904-bd56-3580d5bf6138", + "id": "627c4837-2d98-430f-9b81-ad04d9b671c7", "name": "Gab es Importe?" }, { @@ -1052,7 +1052,7 @@ 1780, 160 ], - "id": "a3575c97-ef97-47f0-9c01-1d75df71c878", + "id": "6de88f1b-0e69-4e99-bf3d-5ec74563da7d", "name": "Statustabelle schreiben", "credentials": { "httpHeaderAuth": { @@ -1076,7 +1076,7 @@ 1780, 340 ], - "id": "d4de1918-7f49-45b9-948a-d22ab2c36473", + "id": "ae7ea0ae-b523-42a4-8716-6c1e183407e8", "name": "Fehler Statustabelle", "onError": "continueRegularOutput" }, @@ -1091,7 +1091,7 @@ 2000, 80 ], - "id": "255f8dee-0294-47e3-aaea-fc094a423dfa", + "id": "ab3897b8-80dc-4efe-99ec-fd7205a9017f", "name": "Meldung formulieren" }, { @@ -1109,7 +1109,7 @@ 2220, 80 ], - "id": "e19c27c0-de80-4318-b965-cf2eb86d1824", + "id": "3856017f-eb4c-463b-ac03-af1d33e478c1", "name": "Benachrichtigung", "disabled": true, "notes": "SMTP-Credential zuweisen, Absender eintragen, dann aktivieren."