English 中文(简体)
第7号意见
原标题:Drupal 7 Views Contextual Filters Title Override

我认为,通过搜索标本进行回收。 它充分处理这一使用案件,我对此感到高兴。 为了达到交付的目的,我需要增加一个标题,而不是“条形”。 显示搜索结果为%1 密码>,初步看得足够容易,但按原计划完全工作。

关于URL = mysite.com/search/all?search=wombat,在这种地方,搜索值是从一个栏内的一个暴露表格中收集的,我要么忘记:

显示搜索“全”结果

或者,如果我进入%1,在标题中,如果在URL中未出现的话,则我可以:

显示搜索结果为%1”。 我的目标是取得“how探结果”

标题高于工作,因为它删除了<代码>。 寻找......部分,但替代物则将“所有”作为例外价值(或我确定为例外价值的任何东西)来计算,在这种情形下,我需要能够拿起 que(研究=殴打)的价值。

谁能在这里展示一些光明?

问题回答

问题在于,你可以用来推翻标题的1%和 %2 指的是您的第一和第二条论点(从理论角度讲),并且是搜索的,也是所有的? 查询:

相反,需要的是作为道路组成部分的 w子。

也许你可以通过处理这一案件来做到这一点:你再次谈到“在URL中不出现主题的权利”的情况。 在背景过滤器科(假设你重新工作的地方)有一个选择,即当有人在场时提供违约值。 也许你可以使用<>PHP代码的备选办法,把你的 w子的铺设和归还作为缺省背景过滤器,然后你可以通过百分比获得。

The php Code to have that part of the URL should look what such as:

return htmlentities($_GET[ search ]);

“GET()”美元将这一变数的价值归为卢尔,而“公司”只是要保持其安全,因为它使用了一部分卢尔,而后者容易受到特别安全的影响。

See if that combo (1) where one isn t present and 2) using that the new setêt in their name publicationout) work!

I fixed this issue. Using following two hooks we can change the defalut value of filter Programmatically.

<?php
/**
* hook_views_pre_view
* @param type $view
* @param type $display_id
* @param type $args
*/
function MODULE_NAME_views_pre_view(&$view, &$display_id, &$args) {
  if ($view->name ==  VIEW_NAME ) {
    $filters = $view->display_handler->get_option( filters );   
    $view->display_handler->override_option( filters , $filters);
  }
}



/**
* hook__views_pre_build
* @param type $view
* @return type
*/
function MODULE_NAME_views_pre_build($view) {
  if ($view->name== VIEW_NAME ) {   
    $view->display[ page ]->handler->handlers[ filter ][ filter_field ]->value[ value ] = 8;
    return $view;
  }    
}
?>

This code worked for me. I am using the drupal 7.





相关问题
Possible pitfalls on a multilingual Drupal site?

I m about to embark on a journey to build a multilingual Drupal site, where I will most likely have to use Views, Panels and Taxonomy pretty heaily. I am a bit worried about the new-node-for-every-...

grouping items in a view

I have a content type called "convention" and a content type called "convention session". Each session has a node reference to a convention. A convention has a "from date" and a "to date", and each ...

Show secondary links in views only

I m building a site in Drupal and I only want to show the secondary links on the pages that use the Views I ve created. I tried using the $secondary_links variable in the views-view.tpl.php but the ...

Node relations in Drupal Views

I m struggling a little bit with a View that gets data from a node that uses two node reference fields, that points to the same type of content. From my path I m getting one string as the argument, ...

Drupal view and path urls

I ve a problem with drupal paths in one view that I building. Right now my view has this form: contents/2/6. Where 2 and 6 are the Ids of two nodes, I d like to manipulate these ids to translate them ...

Drupal Add Static link to a view

I have a Drupal view that lists a node called publication. At the top of the page I d like to have a link new publication instead of having it in the navigation block. Can somebody direct me on how ...

Conditional link to node within views?

I have two content types, book and chapter. Each chapter node contains a node reference of the book to which it belongs. I have created a view which displays the title of each chapter for a given ...

hide single taxonomy term in particular view display

Have a documents content type, with three taxonomies applied to it. Taxonomies are document type (form, policy, other), document group (hr, i.t., training, project specific, etc.), and a free-tagged ...

热门标签