Integration with WP3 Nav Menu Feature

Having Problems? Need Help? Post here!

Re: Integration with WP3 Nav Menu Feature

Postby bedex78 » Mon Oct 18, 2010 1:59 pm

@caribbeanviolin:

The code is supposed to be in your theme's funcitons.php file. But if my guess is correct, I don't think the theme you're using uses the native navigation menu of WP3. The code I provided is for integrating with the native menu. You might have to check on your theme and track down where it is getting its menu from.
bedex78
 
Posts: 31
Joined: Mon Oct 04, 2010 9:11 am

Re: Integration with WP3 Nav Menu Feature

Postby coolcactus » Thu Oct 21, 2010 8:46 am

@bedex78: I've tried all three solutions in my functions.php - but to no avail. Is this supposed to work with the Twenty Ten theme?
coolcactus
 
Posts: 4
Joined: Wed Feb 25, 2009 4:53 pm

Re: Integration with WP3 Nav Menu Feature

Postby bedex78 » Thu Oct 21, 2010 9:09 am

@coolcactus:

I'm sure they can work with the Twenty Ten theme. Did you use WP3's native nav menu? What actually is not working for you?
bedex78
 
Posts: 31
Joined: Mon Oct 04, 2010 9:11 am

Re: Integration with WP3 Nav Menu Feature

Postby Piero » Thu Oct 21, 2010 2:48 pm

bedex78 wrote:Here's another method to direct the links correctly... This time using FILTER, so you can skip the 'Walker' argument in the wp_nav_menu function call.

Code: Select all
add_filter('walker_nav_menu_start_el', 'qtrans_in_nav_el', 10, 4);
function qtrans_in_nav_el($item_output, $item, $depth, $args){
    $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
    $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
    $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
   
   // Determine integration with qTranslate Plugin
   if (function_exists('qtrans_convertURL')) {
      $attributes .= ! empty( $item->url ) ? ' href="' . qtrans_convertURL(esc_attr( $item->url )) .'"' : '';
   } else {
      $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
   }
   
   $item_output = $args->before;
   $item_output .= '<a'. $attributes .'>';
   $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
   $item_output .= '</a>';
   $item_output .= $args->after;
      
   return $item_output;
}


This worked for me, thank you really much Bedex... :*
For other people working with 2010 weaver: you have to add the code above in the theme file called: "2010functions.php".
Now the home link works fine.

Sooo the next issue is the search function. When you switch to any language and then you make a search, you get the search results in the default language.
AAAAAAARG :°(

I wrote emails both to Qian and to the author of 2010 weaver. The first one didn't reply, the second was very kind and demonstrated me this issues are not theme problems, but qTranslate problems. Infact, if you install a new wordpress blog with the standard twenty ten theme and put in the qTranslate plugin the home link is doing that bad thing, and also the search results. I hope there will be fixes for this in the next updates, because qTranslate is really nice and powerfull. I like really much the possibility to edit more languages as tabs in the same page or post.

Bedex, you know I love you. I hope you are a beautiful blonde girl; if not, I love you the same.
Our destinies are in your hands ;)
Piero
 
Posts: 3
Joined: Thu Oct 21, 2010 2:38 pm

Re: Integration with WP3 Nav Menu Feature

Postby bedex78 » Thu Oct 21, 2010 6:55 pm

@Piero:

Haha, you praised me too much.. Sorry to disappoint you, though, but I'm not a beautiful blond girl. I am actually a handsome bearded man! :ugeek:

Anyway, as in regards to the search function, I haven't looked into that yet, but I'd probably be later. But I did make a search in this forum regarding this and found this post that I thought might be useful for you.

viewtopic.php?f=3&t=64&start=0 ('multilingual search ???')

You might want to take a look at that... Cheers! ;)
bedex78
 
Posts: 31
Joined: Mon Oct 04, 2010 9:11 am

Re: Integration with WP3 Nav Menu Feature

Postby caribbeanviolin » Mon Oct 25, 2010 9:17 pm

@bedex78,

Hi there buddy.
It's the violinist still trying to make qTranslate play nice with my WP theme's menu!
Would you mind giving it a try?
It uses something called GANTRY framework (RocketTheme) and some javascript, and it's just above my knowledge level.
I'll pay $100 via paypal to make it worth your while!
What do you say?
I could really use some help.
I've tried custom menus but it's just not the same look and feel...

Please send me an email if this would maybe interest you: e.villa@yahoo.com

Cheers,
-EV
caribbeanviolin
 
Posts: 3
Joined: Mon Oct 18, 2010 2:41 am

Re: Integration with WP3 Nav Menu Feature

Postby leslierad » Thu Nov 18, 2010 12:46 am

Has any one got this working with the “Custom Menu” widget together with custom links?

i.e. when your theme does not support the native navigation menu of WP3 you have the option to add a Custom Widget Menu instead.
leslierad
 
Posts: 18
Joined: Tue Feb 17, 2009 2:27 pm

Re: Integration with WP3 Nav Menu Feature

Postby gabrielortega » Mon Nov 22, 2010 12:53 am

@bedex78 - I've followed your instructions in adding the three versions (not all at the same time!) to my theme's functions.php file, but I'm still not understanding how I'm supposed to be able to use Custom Links for a WP3.0 menu. I'm using Widescreen from GraphPaperPress.com and the latest WP 3.0.1 and qTranslate 2.5.9.

In the Appearance > Menu section, when I go to make a custom link, using either <!--en--> or the [:en] shortcodes end up with a blank URL. How did you make it work for you?

thanks,
Gabriel
gabrielortega
 
Posts: 2
Joined: Fri Sep 04, 2009 5:03 am

Re: Integration with WP3 Nav Menu Feature

Postby bedex78 » Mon Nov 22, 2010 7:04 am

@leslierad:

Haven't tried using the widget myself, but you can just hack the theme so that it accepts the menu by calling the function (search in the Wordpress site for the tutorial on it).


@gabrielortega:

Are you using the shortcodes on the URL?? It should be for the title. But if it still doesn't work, it may be that the theme you're using has its own menu system.
bedex78
 
Posts: 31
Joined: Mon Oct 04, 2010 9:11 am

Re: Integration with WP3 Nav Menu Feature

Postby NengQs » Mon Nov 22, 2010 11:10 am

Hi all I'm new for this plugin.

I have some question?
In “Custom Links” this plugin can add Url Different.?
Ex: I have one menu "Ajex" and I have 2 Language "Eng" and "Ducth"
Can I add “Custom Links” in menu "Ajex"
Language "Eng" To URL google.com/en/
and Language "Dutch" To URL google.com/nl/
This Can Possible ?


Thank for Answer.
NengQs
 
Posts: 1
Joined: Mon Nov 22, 2010 10:58 am

PreviousNext

Return to qTranslate Support Forum

Who is online

Users browsing this forum: Google [Bot] and 9 guests