Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1305073

    Ich verwende das Widget Table of Contents als Inhaltsverzeichnis, was sehr praktisch ist.
    Beispiel: https://www.wellensittich-infoportal.de/kraeuter-fuer-wellensittiche/

    Allerdings werden die Umlaute in den Anchor nicht richtig dargestellt.
    /kraeuter-fuer-wellensittiche/#k-chenkr-uter-f-r-wellensittiche

    Vielleicht hat die Forengemeinschaft einen Tipp, damit die Sprungmarken korrekt dargestellt werden.

    Ich verwende Enfold Version: 4.8.3, die Datenbanktabellen haben utf8, welche in der Config hinterlegt sind.

    #1305488

    Hey Maik,

    Thank you for the inquiry.

    The umlauts seems to be displaying properly on our end. Please check the screenshot below.

    Screenshot: https://postimg.cc/1npb0dWt

    In the actual link, the umlaut characters have to be converted for the anchors to work correctly.

    Best regards,
    Ismael

    #1476423

    Hallo Support-Team,

    Ich muss hier leider nochmal schreiben. Ich habe ein Problem mit der automatischen Generierung der Anker-IDs in der avia_auto_toc. Leider werden Umlaute entfernt, anstatt sie korrekt umzuwandeln (z. B. ä -> ae, ü -> ue, ß -> ss). Dadurch ist das Inhaltsverzeichnis nicht optimal für SEO.

    Screenshot

    Wie kann ich die Anker-Generierung so anpassen, dass sie Umlaute richtig behandelt und SEO-freundliche IDs erzeugt? Gibt es eine empfohlene Lösung für dieses Problem?

    Vielen Dank für eure Unterstützung!

    Hello Support Team,

    I’m reaching out again as I’m still experiencing an issue with the automatic generation of anchor IDs in avia_auto_toc. Unfortunately, umlauts are being removed instead of being correctly converted (e.g., ä -> ae, ü -> ue, ß -> ss). As a result, the table of contents is not optimized for SEO.

    How can I adjust the anchor generation so that it correctly handles umlauts and creates SEO-friendly IDs? Is there a recommended solution for this issue?

    Thank you for your support!

    Best regards,

    • This reply was modified 1 month ago by Maik.
    • This reply was modified 1 month ago by Maik.
    • This reply was modified 1 month ago by Maik.
    #1476490

    Hi,

    Thank you for the update.

    It’s been a while and the screenshot that we provided is no longer available. You may need to avoid using special characters such as umlauts as anchors or as ID attribute to prevent the issue with the links.

    Best regards,
    Ismael

    #1476508

    you have to edit the function av_pretty_url(text) in avia-snippet-widget.js
    there you see that a lot of characters are replaced by “-”
    we now had to find a solution where ä is ae; ü is ue etc. …

    #1476509

    on : avia-snippet-widget.js i commented out the first regex – hope that this will not come into conflict with other settings.

    function av_pretty_url(text)
    {
    	return text.toLowerCase()
    		// .replace( /[^a-z0-9]+/g, "-" )
    		.replace(/ /g,"_")
    		.replace( /^-+|-+$/g, "-" )
    		.replace( /^-+|-+$/g, '' )
    		.replace(/ä/g, 'ae')
    		.replace(/ö/g, 'oe')
    		.replace(/ü/g, 'ue')
    		.replace(/ß/g, 'ss');
    }

    see: https://webers-testseite.de/datenschutz2/
    for example datenschutzerklärung

    download it here (both files min.js too) : https:://webers-testseite.de/avia-snippet-widget.zip

    you know how to have child-theme js files?

    #1476529

    Thank you for the help and the files.
    I uploaded both js files in the Child Theme in the js folder. */themes/enfold-child/js
    But somehow the umlauts are not all converted.

    Screenshot


    @Guenni007
    – Wir können auch gerne in Deutsch schreiben. 😉

    • This reply was modified 1 month ago by Maik.
    • This reply was modified 1 month ago by Maik.
    • This reply was modified 1 month ago by Maik.
    #1476547

    thats why i wrote:

    you know how to have child-theme js files?

    The Subfolder Structure is korrekt

    put this to your child-theme functions.php:

    function wp_child_theme_widget_script() {
      wp_deregister_script( 'avia-widget-js' );
    
      $vn = avia_get_theme_version();
      $options = avia_get_option();
      $child_theme_url = get_stylesheet_directory_uri();
    
      $min_js = avia_minify_extension( 'js' );
    
      $condition = ( avia_get_active_widget_count() > 0 );
      avia_enqueue_script_conditionally( $condition , 'avia-widget-js-child', "{$child_theme_url}/js/avia-snippet-widget{$min_js}.js", array('avia-default'), $vn, true);
    }
    add_action( 'wp_enqueue_scripts', 'wp_child_theme_widget_script', 100 );
    #1476602

    @Guenni007 – Thank you very much! 🙏 Now the umlauts in the TOC are displayed correctly.🎉

    I’m surprised that no other German website operators have this error or don’t notice that the theme doesn’t handle umlauts very well in the TOC. This would actually be a function for the main theme so that there are no more inquiries of this kind.

    #1476647

    ich denke da muss man noch an den Regex nacharbeiten. Ich habe mal Günter gefragt ob er sich der Problematik annehmen möchte.
    Leider sind meine Skills da begrenzt.

    #1477038

    @Guenni007 Das wäre sehr gut. Seltsam ist auch, dass bei h3 und kleiner die Wörter im Anker mit – getrennt werden und bei h2 mit _ 🤷‍♂️

    #1477103

    Günter hier vom Team hat mir mittlerweile einen wohl bessere Version der Funktion dort unten zukommen lassen.
    Unten hat man jetzt :

    function av_pretty_url(text)
    {
    	return text.replace(/[ÄÖÜäöüß]/g, function(match) {
    				return {
    					"Ä": "Ae", "Ö": "Oe", "Ü": "Ue",
    					"ä": "ae", "ö": "oe", "ü": "ue",
    					"ß": "ss"
    				}[match];
    			})
    			.toLowerCase()
    			.replace( /[^a-z0-9]+/g, "-" )
    			.replace( /^-+|-+$/g, "-" )
    			.replace( /^-+|-+$/g, '' );
    }

    hier kannst du wieder die beiden Datein herunterladen – in Version 7 wird das dann wohl eingebaut sein.
    und kann dann aus dem child-theme js Ordner gelöscht werden. Die Funktion zum einbinden der Child-theme Datei dann auch.
    https://webers-testseite.de/avia-snippet-widget.zip

    #1477233

    Vielen Dank

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.