How to remove the latest content from Drupal View when the filter is activated?

I find it difficult to understand how to make the Drupal 7 view do what I want. I have experience with Drupal, but not much in php programming itself.

What I use:

 Druapl 7, View 3, Entity, Date

What I've done:

I created two views. One shows the latest type of content, and the other shows the rest. On the second type of content, you have a filter in which you can filter the content based on their category. (Categories are created with an entity module)

1 viewing options:

  • Filter Criteria: Content Type
  • Sorting criteria: start date (desc) (datemodule)
  • Pager: displays the specified number of elements: 1 element.

2 viewing settings:

  • Filter criteria: content type, selected category (set)
  • Sorting criteria: start date (desc) (date module)
  • : | , 1

:

1 , . 2 , "any". . , , 1 .

:

, , "2- " ( ) ( , "1 " ).

, , , , - php-. , .

, . node , . , , , , .

, , .

:

, .

"2 "

(): A: A

:

  • B: A,
  • C: A,
  • D: B,
  • E: B.

: :

  • B: A,
  • C: A,

: B :

  • D: B,
  • E: B.

1, , B, " B". , 2 ( ) , : " A: A"

+4
1

, . , . hook_views_pre_render, . , . , . https://api.drupal.org/api/views/views.api.php/function/hook_views_pre_render/7

if( empty($view->exposed_raw_input['my_input']['filter_field'])) {
  array_shift($view->result);
}

, . .

0

All Articles