drupal-views

filtering a Drupal View with ORed criteria

可紊 提交于 2019-12-02 00:37:22
问题 I'm attempting to present a Drupal View that shows nodes in which the user's e-mail address shows up in one of two CCK text fields. Unfortunately, this doesn't seem to be possible using the stock version of Drupal's Views module - there doesn't appear to be a way to combine filtering criteria (except ANDing them), nor does their appear to be a way to do the custom logic for the filter's setting... Is there a simple way of directly injecting additional information into a specific View's WHERE

filtering a Drupal View with ORed criteria

a 夏天 提交于 2019-12-01 21:01:58
I'm attempting to present a Drupal View that shows nodes in which the user's e-mail address shows up in one of two CCK text fields. Unfortunately, this doesn't seem to be possible using the stock version of Drupal's Views module - there doesn't appear to be a way to combine filtering criteria (except ANDing them), nor does their appear to be a way to do the custom logic for the filter's setting... Is there a simple way of directly injecting additional information into a specific View's WHERE clause? If not, can it be done in another way? You can use the views_or module. It's still in dev but

Drupal Views2 Exposed Form how to change

孤人 提交于 2019-12-01 11:16:24
I have a View with an exposed form . I am trying to a few things on it. Ideally I would like to have a dropdown that fires the form with no button. If that is not possible then I would like to have the button text something different than apply. I hacked it for now and change views_form in views.module but that does not seem like the right way to do it. I only have one exposed form right now, but what if I add more? Please see http://www.wiredvillage.ca/News for my example. I am poking around drupal.org and seeing others with the same problem but no solutions so far. Not sure where the best

Embed a View using AJAX

僤鯓⒐⒋嵵緔 提交于 2019-11-30 15:57:47
I have a view with one argument, and a set of exposed filters. When the user filters the view, the form is submitted using Ajax, and the filters are appended to the url using location.hash. My goal is to filter the view upon initial page load, if the filters are present in the location.hash. Currently, I'm loading the view through an Ajax callback, which works perfectly fine. But the big problem is that Ajax for the view doesn't work. This is the callback that loads the View. // Load the view object. $view = views_get_view('taxonomy_term'); $view->set_display('page'); $view->set_use_ajax(TRUE)

How to change the label of the default value (-Any-) of an exposed filter in Drupal Views?

穿精又带淫゛_ 提交于 2019-11-30 08:26:12
I created a view which has three exposed filters. Everything works fine except the fact that I can neither translate or change the default string (-Any-) for the dropdowns. Is there a way to change this string to something more meaningful like "Please Select" and make it translatable so the German version displays "Bitte wählen"? I have two screen captures that may be helpful: and A further improvement would be the ability to change the text "any" to something like "please select a (field name here)" but I am losing hope for that =) UPDATE IMPORTANT: On further testing, I found that if you

Embed a View using AJAX

人盡茶涼 提交于 2019-11-29 23:45:03
问题 I have a view with one argument, and a set of exposed filters. When the user filters the view, the form is submitted using Ajax, and the filters are appended to the url using location.hash. My goal is to filter the view upon initial page load, if the filters are present in the location.hash. Currently, I'm loading the view through an Ajax callback, which works perfectly fine. But the big problem is that Ajax for the view doesn't work. This is the callback that loads the View. // Load the view

displaying a Drupal view without a page template around it

南楼画角 提交于 2019-11-29 19:52:24
I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes. This view would be included in another, non-Drupal site. I expect to have to do this with a number of views, so a solution that lets me set these up rapidly and easily would be the best - I'd prefer not to have to create a .tpl.php file every time I need to include a view somewhere. I was looking for a way to pull node data via ajax and came up with the following solution for Drupal 6. After implementing the changes below, if you add ajax=1 in the

OR operator in Drupal View Filters

瘦欲@ 提交于 2019-11-29 03:56:07
I need to implement an OR operator between some filters in a Drupal View. By default, Drupal AND's every filter together. By using hook_views_query_alter(&$view, &$query) I can access the query ( var $query ) , and I can change either : $query->where[0]['type'] to 'OR', or $query->group_operator to 'OR' The problem is however, that I do not need OR's everywhere. I've tried changing both of them to OR seperately, and it doesn't yield the desired result. It seems changing those values, puts OR's everywhere, while I need => ( filter 1 AND filter 2 ) OR ( filter 3 ), so just 1 OR. I could just

Drupal 7 Views 3 user:current filter is missing?

匆匆过客 提交于 2019-11-28 21:11:09
I'm trying to filter a view to display only nodes of the current user. Filter by user:current is missing however, where can it be found/enabled? I must be missing something simple. In Drupal 7, Views 3, you must add the Relationship of Content: Author on the right side under the Advanced settings. Once you've added that relationship, you will be able to see the User: Current filter. You can use another method without require any relationship. in Advanced settings add Contextual filters select Content: Author uid and in settings of it select Provide default value ,in type selectbox choose User

Drupal Views: Display recent nodes created by user on profile page

China☆狼群 提交于 2019-11-28 18:54:29
I'm wondering how I can display the recently created nodes by a user on their profile page. I've created a new page for a user at /user/%user and I want to be able to display the latest nodes created by that user. ok, the answer involves creating a drupal view, so you will need the views module and although simple, the answer is lengthy. please bear with me through this... :) (i am actually doing this on a test site as i write the instructions, to make sure i dont miss anything...) i assume that you know how to download and install the views module. make sure you also enable the views-ui