
-
AuthorPosts
-
June 10, 2021 at 1:21 pm #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-wellensitticheVielleicht 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.
June 14, 2021 at 4:42 am #1305488Hey 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,
IsmaelFebruary 5, 2025 at 4:13 pm #1476423Hallo 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.
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,
February 6, 2025 at 9:22 am #1476490Hi,
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,
IsmaelFebruary 6, 2025 at 12:07 pm #1476508you 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. …February 6, 2025 at 12:31 pm #1476509on : 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ärungdownload it here (both files min.js too) : https:://webers-testseite.de/avia-snippet-widget.zip
you know how to have child-theme js files?
February 6, 2025 at 3:41 pm #1476529Thank 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.
@Guenni007 – Wir können auch gerne in Deutsch schreiben. 😉February 6, 2025 at 6:42 pm #1476547thats 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 );
February 7, 2025 at 7:23 am #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.
February 7, 2025 at 6:36 pm #1476647ich 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.February 13, 2025 at 10:28 am #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 _ 🤷♂️
February 14, 2025 at 7:18 am #1477103Gü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.zipFebruary 17, 2025 at 10:29 am #1477233Vielen Dank
-
AuthorPosts
- You must be logged in to reply to this topic.