English 中文(简体)
使用$_GET[...]在 hdrupal-7 中[关闭]
原标题:Using $_GET[...] in drupal-7 [closed]

我找不到一个适合我的问题的标题

我一直试图在我的Drupal网站上加入一个美丽的搜索栏(http://loopj.com/jquery-tokeninput) 。 要做到这一点,我需要创建一个php回调功能,该功能应该像 www.mysite.com/search/callback?q=var1。

这是一个先决条件,我不能不这样做。然而,在驾驶上,你设置了类似于www.mysite.com/search/callback/var1的Urls。

有办法在德鲁帕尔实现第一个目标吗?

谢谢:-)

EDIT-1: What I have already done is :

$items[ search/callback ] = array(
       title              =>  Search for String ,
       description        =>  callback function for search bar ,
       page callback      =>  search_callback ,
       access callback    => TRUE,
       type               => MENU_CALLBACK,
)
最佳回答

I can recomend you to explore full example for jQuery UI Autocomplete taxonomy terms here: http://xandeadx.ru/blog/drupal/526. It s originally written in Russian but you can easily read code listings and download packed project. I think you can use the same idea of module.
Some notes:

  1. You can t use q get param for your purpose because it is used by Drupal internally. In jQuery Tokeninput you can set another name of param with queryParam option.
  2. I recommend to check any $_GET param with check_plain().
问题回答

暂无回答




相关问题
Drupal Multi-language: Simple strings not translated

I m adding additional languages to a Drupal site that I m building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date ...

Setting up a WYSIWYG editor for Drupal site users [closed]

Looking through the Drupal contrib modules, and after a few Google searches, it becomes evident that there are any number of choices and combos available to set up a WYSIWYG editor in Drupal. I m ...

Change size of user/password login box

I don t know how to change the size of the login username/password boxes on the drupal site that I m trying to build. I m stumbling through the theming, and don t know where to find the file that ...

How does Drupal provide an edit/review/publish model?

How does Drupal support a means to update and review a website before it is published? Does it only allow you to preview a page at a time before you publish it or is there a way to create a site ...

Term for rotating header

I m looking for terminology that describes this behavior: The header of a web-page contains a different image every time you visit it. Update: It is not an advertisement, but images related to the ...

Has anyone checked out Drupal 7? [closed]

Has anyone checked out a copy of Drupal 7 yet? What do people think? I m pretty excited about the PDO and all of the designers I work with a very excited about the new admin interface/structure. Do ...

热门标签