Forums

WP-dTree
wp-dtree + wpml don't work (3 posts)

  1. Lethys
    Member
    Posted 1 year ago #

    Hi

    I'm posting here because i have a problem with wp-dtree and WPML.
    All things work withe the main language of the site (French) but when we change the language, the tree won't open when we clic on it.

    In the main language there is this :

    <!--
    try{
    /*WP-dTree: cat1 request was 'category/ramasseuse'. I found: '-3'*/
    
    cat1.openTo('-3', true);
    }catch(e){} //-->

    but in english this is the result :

    <!--
    try{
    /*WP-dTree: cat1 request was '/category/gatherers' */
    }catch(e){} //-->

    He didn't find the requested category wich is
    cat1.a(-32,0,'Gatherers','','category/gatherers','','');

    I think this is maybe because of the '/' before the name, but i don't know how to fix it...

    http://wordpress.org/extend/plugins/wp-dtree-30/

  2. Lethys
    Member
    Posted 1 year ago #

    no one?

  3. Lethys
    Member
    Posted 1 year ago #

    Just a simple hack, it's dirty but it works :

    if($args['opentoselection'] && isset($_SERVER['REQUEST_URI'])){
    
    			// si les premiers caracteres sont  '/es/' ou '/en/' (pour es et en)
    			if ( substr($_SERVER['REQUEST_URI'], 0, 4) == "/es/" or substr($_SERVER['REQUEST_URI'], 0, 4) == "/en/" )
    		{
    			$url =	substr($_SERVER['REQUEST_URI'], 3);
    		}
    			else
    		{
    			$url = $_SERVER['REQUEST_URI'];
    		}
    			$tree .= $opt['openscript'] . wpdt_open_tree_to($url,'', $tree) . $opt['closescript'];
    		}

    My website change with /es/ and /en/ that's why it's in the if.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags