Course Categories Navigation widget title bug with WPML

Home Forums Legacy Support Support queries Translation issues Course Categories Navigation widget title bug with WPML

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #123365
    waytogo
    Spectator
    The first entry/category (all courses button) in the Course Categories Navigation widget of the "All Courses"/Course Directory page always shows the title of the page and not the title of the widget. A second bug is that if you use WPML and you have an English translation of the "All Courses" German page (for example) it still shows the title of the German page as the first category, means the German (default language) page title and not the "All Courses" English title. Actually it should show either the German widget title or the English widget title and not the page title at all. Is there are fix?
    #123366
    waytogo
    Spectator
    Also trying a second sidebar for the second language and using a second version of the widget didn't help.
    #123367
    waytogo
    Spectator
    I found the position of the problem in includes/widgets/custom_bp_widgets.php line 394:
        echo '<li class="'.((bp_current_component() == 'course' && is_page())?'current-cat':'').'">'.get_the_title($course_dir).'
  • '; The problem is $course_dir between the a-Tag which should be the widget title or it doesn't show the translated $course_dir string.
#123463
H.K. Latiyan
Participant
Hi, Thanks for pointing this out we'll check this issue and resolve it.
#123469
waytogo
Spectator
I got the solution. If you change what is in the a-Tag "get_the_title($course_dir)" and replace it to $title (which is actually the title of the widget) then it is solved. The question for me and now for a fast solution is, how I can change this without changing the core file, means what do I have to enter in my functions.php in my childtheme?
#123568
H.K. Latiyan
Participant
Hi, This is not the solution for this. Actually in the course category navigation widget we never show the widget title, we always shows the all courses page there. But the issue is that the all courses page is not shown according to the current language. So to resolve this issue you'll have to check the page id and then show the all courses page. Here is the solution for this: http://prntscr.com/g4bql8 The lines to be added is: if(function_exists('icl_object_id')){       $course_dir = icl_object_id($course_dir, 'course', true);     } --------------- You can add this if you want in the main wplms theme only, for the next update we have already added it so it will not be changed.
#123603
waytogo
Spectator
Thank you very much for the quick response. This solves the bug how you have programmed it. Great! So what if I want to show the widget title which makes more sense for us. The page title in German means "Course Directory" but the widget, means the first entry, should be in German "All subjects/courses". So my solution leads to an override of this function/class in the child theme but I don't know how to do it correctly without influencing future updates of the core file. Is there a chance?
#123706
H.K. Latiyan
Participant
Hi, The widgets are hard coded and it cannot be overwritten. However there is an alternative to it, you can place a text widget above this widget and then add the title there. OR You can register a new widget with the same functionality in your child theme but with different name. Then make changes you want in that new widget and then use the new widget instead of this one.
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Course Categories Navigation widget title bug with WPML’ is closed to new replies.