0

In the content page, there is a filter that shows the page, and other types of content.

Is there a way for me that will allow me to show only certain types of items in the content type.

Thank you, Kevin

0

You can use Administer views but to quickly achieve this I would use the hook_form_alter.

Do something like this, Although I would recommend you set this restriction to specific role but for this example I am going to ignore roles. Within hook_form_alter you do

if($form['#form_id] == 'node_admin_content') {
   unset($form['filter']['filters']['status']['filters']['type']['#options']['article']);
}

You can change the ['article'] to whatever the machine name of your content type is. use devel to find out what elements the $form variable contains.

  • Why not just create a new view or change the existing one via the UI? – Kevin Oct 17 '17 at 18:46
  • Yes but instead of creating a new view installing the module I suggested on my answer will be easier and works well too. – Sanjok Gurung Oct 18 '17 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.