Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1072361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:51:07+00:00 2026-05-16T20:51:07+00:00

I have created a custom content type and using views2 for creating various page-views.

  • 0

I have created a custom content type and using views2 for creating various page-views. I have used a taxonomy (having 4 terms, say “A”, “B”, “C” and “D”) for broader categorization of this content type. There are 4 other taxonomies corresponding to each of the above terms “A”, “B”, “C” and “D” called “Taxonomy-A”, “Taxonomy-B”, “Taxonomy-C” and “Taxonomy-D” which are used to further sub-categorize this content type in a particular category (say “A” or “B” etc.). The sub-category “Taxonomy-A” is visible on the node edit form only if broader category “A” is selected. Similar is the case with “B”, “C” and “D” categories.
Now in my page-views, i have used Taxonomy terms “A”, “B”, “C” and “D” as my first arguments of the url. Thus the following url

http://www.example.com/A

provides all the published custom content types of “category A”. Similar will be the cases for “category B”, “category C” etc.
Now to filter my content types of a particular category (say “A”) into its sub-categories, i have created FOUR exposed filters corresponding to each Taxonomy “Taxonomy-A”, “Taxonomy-B”, “Taxonomy-C” and “Taxonomy-D”.
Now i would like to show only one filter on each type of “page-view”;i.e.
Filter corresponding to “Taxonomy-A” on http://www.example.com/A page-view
Filter corresponding to “Taxonomy-B” on http://www.example.com/B page-view
Filter corresponding to “Taxonomy-C” on http://www.example.com/C page-view etc.

If i configure basic setting of view to show filter in a separate block, then the filter block contains all the Four Filter plus apply button. But I want to show only one filter (based on page url’s first argument) with apply button.

Actually i would like to decouple all the exposed filters with each other and make each exposed filter as a separate block which can be assigned to a template region.
Is it possible to achieve this by theming (each select element on views exposed filter form has different “id”)? Otherwise the only option left with me is to create separate content types for each category “A”, “B”, “C” and “D”, which is not a practical solution if the number of categories are large.

How i can achieve this?

Thanks in advance for your response!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:51:08+00:00Added an answer on May 16, 2026 at 8:51 pm

    1. Super Slick

    Well, the slick way would be to look at how you might modify Views to spit out the different exposed filters into different blocks, possibly determined by a block delta setting in the configuration for each filter. That would be neat.

    2. Overkill/Redundant/FAPI-hook_block() Drill

    Get your exposed block, then use hook_form_alter() to hide the filters you want to put on a different block. Then create new blocks programmatically in a new module (or if you absolutely must, the PHP Filter module and a custom block through the GUI). In that module, replicate the form elements you need in that block, including the unique exposed filter. It’s useful to remember that exposed filters don’t care about the form. They care about the querystring. You could type in your filter arguments in the URL if need be.

    3. Conditional Modification

    Implement hook_form_alter() for the form displayed in the exposed filter. To identify this form, you will first need to get the id for the views_exposed_form (not sure it’s that) then get a more specific identify out of the forms array to target only this exposed form. (You’d need this for approach #2 anyway).

    Now that you have that, you can do a couple things. First, keep in mind that if you are aggressive about caching this block in a gobal way, this will break. Cache per page, or at whatever granularity you intent to change the block. For each filter you want to hide, you are going to put some logic into $form['#access'] so Drupal can look at the form element, look at the page it’s on, and hide that form element because it’s not in use.

    If you happened to be relying on the current page path, you might do something like this:

    $form['taxonomy_b_filter']['#access'] = arg(0) == 'section';
    

    This tells Drupal to hide the imaginary ‘taxonomy_b_filter’ element if the current page path looks like http://example.com/section.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a content type which is created using CCK's(Establishment). I have used $form['#redirect']
I have created a custom post type named People. I have created a page
I have created a custom content type that has a ReferenceField. When I set
I have a custom content type create in visual studio 2010: custom http://img204.imageshack.us/img204/439/customf.jpg Here
I have created custom posts and I want one page in my site to
I have created custom cell in which there are n number of image views.
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I am building a custom ,module with a custom content type. I have defined
Using Marius Gedminas's excellent blog post , I have created a custom traverser for
I've created some custom fields to be displayed using the CommonViewFields for a Content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.