Custom title for custom filter

Home Forums Calendar Products Filter Bar Custom title for custom filter

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1300954
    ite
    Participant

    Hey,

    I’ve followed this article to add two custom filters to my filter bar.
    However, I am trying to achieve a look similar to the image attached, where the filters are all select’s, and the default value, which today is hard coded as “Select”:
    Line 201 in Filter.php:
    <option value="" <?php selected( trim( $current_value ), '' ) ?>><?php esc_html_e( 'Select', 'tribe-events-filter-view' ); ?></option>

    What I want is the possibility to replace this “Select”-value with the heading for the filter instead. How can I achieve this?

    #1301576
    ite
    Participant

    Hey!

    I found a solution – you can override the public function displayFilter() in the custom filter to change the look and feel of a filter. Using the Filter.php’s public function displayFilter() as a template, I was able to create something similar to the screenshot.

    #1301614
    Cliff
    Member

    Hi, ite. Thanks for sharing that you found your solution.

    Did you accidentally paste the same thing twice, or are you saying you extended the class and overrode the displayFilter method?

    Did you find any errors or shortcomings in that knowledgebase article? If so, we’d love to fix it.

    Or, if you have suggestions for how to improve the core plugin’s code, please let me know that.

    Thank you!

    #1301617
    ite
    Participant

    Hi Cliff,

    I was expecting the code blocks to work similar to how they work on StackOverflow, so that’s why it looks funky – there really isn’t any shortcomings, but I wish the knowledgebase included information on how to customise everything about the filters, such as how they’re displayed! I had to peek around the code to find the correct function to override in the sub-class, but I managed 🙂

    #1302629
    Cliff
    Member

    Gotcha.

    Feel free to suggest specific edits you’d recommend to help other developers, too.

    If not, no worries.

    Please note that threads get Closed automatically after a couple weeks of inactivity. If it does get Closed, please open a new thread, adding your current problem description and also linking back to this thread.

    Thank you!

    #1321739
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Custom title for custom filter’ is closed to new replies.