-
AuthorPosts
-
January 23, 2014 at 11:36 am #213784
Hey,
We have many problems that are related multilingual pages that contain advanced editors.We have latest WPML version with 3 languages – finnish (default), swedish and english.
We use permalinks for our pages and posts.Here is a scenario that doesn’t work well:
1. Create and publish a page called item-finnish (and translate it to english)
2. Create a page called container-finnish, and create an icon list
3. Edit the icon list, and edit the first list item. Set the item to point to “item – finnish” page
4. Publish the page, and translate it to english.
5. In the advanced editor create an icon list. Edit it and set the first icon item to point to a page. Select “item-finnish” (“item-english” does not appear on the list. Only finnish pages appear)
6. Publish the english container page
7. Now view the finnish container page and the english container page. The first item in the list in both pages points to item-finnish.It seems that only if we use manual URLs we can get it work. It doesn’t really seem to be WPML compliant.
We have many other more problems. For example, we have pages that list posts from a certain category.
We use Blog Posts, and then we choose to present blogs from the news category (each category is in it self translated to english and swedish).
The problem is that usually, when we edit the blog posts in a translated language, we see the list of categories in Finnish. It seems that the safest way to create the blog posts in the correct language is to edit it in the default editor, and change the categories value in the av_blog element. However, the default editor sometimes appear to be empty (even when we see the blog-posts element in the advanced editor), and then we have to update the categories value directly in the database.These are just two examples of several issues we had, and it really delays our development.
We really need your advise on this issues.
Thanks,
LiorJanuary 23, 2014 at 4:03 pm #213906Hey modelity!
Our theme removes the entries( pages, etc.) of the other languages by default because many user (who have to maintain many pages) requested this feature. If you want to include all pages (English, Finish, etc. entries) into the select option insert following code at the very bottom of functions.php
add_action( 'init', 'avia_deactivate_wpml_page_filter', 10); function avia_deactivate_wpml_page_filter(){ remove_filter( 'avf_dropdown_post_query', 'avia_wpml_filter_dropdown_post_query', 10, 4); }
Regards,
PeterJanuary 26, 2014 at 9:28 am #214979Great, we’ll try it…
Thanks,
LiorJanuary 26, 2014 at 10:21 am #214984Now we can select the page in the proper language, but we see all pages in the pages list of the icon item.
For example, if we have a Home page, then we see Home, Hem (swedish) and Koti (finnish).
Could we restrict the list to show only pages in the language of the referring page?January 27, 2014 at 9:18 am #215219Hey!
That’s why we added this filter function. I’m not sure why it does not list all translated entries of the current language on your website though. You can try ton insert following code at the bottom of functions.php:
add_action( 'init', 'avia_deactivate_wpml_page_filter', 10); function avia_deactivate_wpml_page_filter() { remove_filter( 'avf_dropdown_post_query', 'avia_wpml_filter_dropdown_post_query', 10, 4); add_filter( 'avf_dropdown_post_query', 'avia_custom_wpml_filter_dropdown_post_query', 10, 4); } function avia_custom_wpml_filter_dropdown_post_query($prepare_sql, $table_name, $limit, $element) { global $wpdb; $wpml_lang = ICL_LANGUAGE_CODE; $wpml_join = " INNER JOIN {$wpdb->prefix}icl_translations ON {$table_name}.ID = {$wpdb->prefix}icl_translations.element_id "; $wpml_where = " {$wpdb->prefix}icl_translations.language_code LIKE '{$wpml_lang}' AND "; $prepare_sql = "SELECT distinct ID, post_title FROM {$table_name} {$wpml_join} WHERE {$wpml_where} AND post_type = '".$element['subtype']."' ORDER BY post_title ASC"; return $prepare_sql; }
It will list all entries of the current language without any limit (by default Kriesi adds a limit to the sql query to avoid errors on websites with several hundred posts/pages) and without taking care of the post status (published, draft, etc.).
Regards,
PeterJanuary 28, 2014 at 7:17 am #215673I think I was misunderstood here…
It does list all the pages of the current language (at least I didn’t notice that a page was missing).
The issue here is that it lists the pages of all languages, and I think it would be more convenient for it to list only the pages of current language.
In my wildest dreams I would even say that I would like to translate the page with the icon list from the default language, and all the page references in the icon list of the translated page would automatically point to the corresponding pages in that language (but I guess that’s not going to happen…)January 28, 2014 at 11:11 am #215730Hey!
Normally Enfold will just show the pages of the current language and it will remove all pages from the query which are translated in a different language. However if I understood your first post correctly Enfold does not list all pages of the current language on your server (because of reasons I don’t know) and thus you must remove the page filter with the code I posted here: https://kriesi.at/support/topic/advanced-editors-wpml-compatibility/#post-213906 and then it will list all pages of all languages. I’m aware of one similar bug report: https://kriesi.at/support/topic/post-slider-does-not-work-in-other-languages/ and the user had to update the WPML plugin to fix the issue. You can try to re-install the WPML – maybe it fixes the issue. If not try to deactivate all third party plugins except WPML and check if a plugin affects the query somehow. If the filtered page list still doesn’t show all pages of the current language then something must be wrong with the database because the sql query seems to work for all other users…
Cheers!
PeterJanuary 28, 2014 at 4:24 pm #215858Oh, now I see. Because as I understood from your reply here, that it listed the pages only in the default language (instead of current language, or maybe when you refer to current language you mean default language?) because users requested this behavior, and that it is not a bug.
We will try to re-install WPML or deactivate other plugins.
Thanks,
LiorJanuary 28, 2014 at 6:00 pm #215929Hey!
or maybe when you refer to current language you mean default language?
No, I mean the current selected language which is visible in the dropdown/language switcher in the admin bar.
Best regards,
Peter -
AuthorPosts
- The topic ‘Advanced editors WPML compatibility’ is closed to new replies.