开发者

Drupal filter is not working properly

I'm not sure how to ask it, so if you need anymore additional information, please ask for it!

Situation

I've got a website in three languages. I got a lot of customer cases online each connected to a sector (depending in which sector they belong). Each sector and reference has it's own unique nid.

In my template.php开发者_JAVA技巧 it's stated like this:

if ('sector' == $vars['node']->type) {
        $lang = '/'.$vars['language'].'/';

        $key_path = $_SERVER['REQUEST_URI'];
        $key_path = substr_count($key_path, $lang) ? substr($key_path, strlen($lang)) : $key_path;
        if (strpos($key_path, '?')) $key_path = substr_replace($key_path, '', strpos($key_path, '?'));

        if (strpos($key_path, 'sectors-references') === 0) {        
            $view = views_get_view('references');
            if (!empty($view)) {
                $view->set_arguments((int)$vars['node']->nid);  
                $vars['content']['suffix'] = $view->render();

            }
        }
    }

And yet, every sector shows me the same references... What do I have to change to get the correct reference under the right sector?


Usually arguments are passed to set_arguments using an array, if you pass a non-array the argument will probably be ignored which is why you're always getting the same result. Try:

$view->set_arguments(array((int)$vars['node']->nid));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜