I'm in the process of writing a custom views filter handler. In order to learn from the existing filters, I'd like to know how I can tell which filter class views is using when I'm configuring an (exposed) filter on the GUI.


Adding an exposed view filter inserts the following (sample) code into the view output:

 <div class="view view-... view-id-... view-display-id-default view-...-id-1">
    <div class="view-header">

    <div class="view-filters">
        <form action="..." accept-charset="UTF-8" method="get" id="views-exposed-form-...">
            <div class="views-exposed-form">
               <div class="views-exposed-widgets clear-block">
                  <div class="views-exposed-widget views-widget-filter-tid">
                     <label for="edit-tid">...</label>
                     <div class="views-widget">
                        <div class="form-item" id="edit-tid-wrapper">
                           <select name="tid" class="form-select" id="edit-tid" >
                              <option value="All">...</option>...
                 <div class="views-exposed-widget views-submit-button">
                    <input type="submit" id="edit-submit-..." class="form-submit" />

It is not clear, though, why you can't find out the same by simply creating a view, exposing its filter and looking up the source code. Perhaps you could explain your question better?

  • 1
    I think BetaRide is trying to create a custom filter in a module and then trying to implement a class into the field's output. So the question really is, how to define the class that gets attached to the HTML output through the module. That's my guess though.
    – Ambidex
    Jun 5 '12 at 11:26

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.