Set Default Columns on My Events page

Home Forums Calendar Products Community Events Set Default Columns on My Events page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1389183
    Sean
    Participant

    Hi,

    We’d like to hide the Display Options button that is located at the top of /events/community/list and set certain columns of data as “active” so that our users will always have specific columns viewable. We know how to hide the Display Options button via CSS, but how can we set which columns of data are activated/checked on the back-end? In our case, we want to hide the following columns: Category and End Date.

    Thank you,
    Karly

    #1390016
    Andras
    Keymaster

    Hello Karly,

    Thanks for reaching out with your question! That’s a good one.

    I believe the easiest would be to create a template override for this file:

    the-events-calendar-community-events\src\views\community\event-list.php

    (More details about creating a template override in our Themer’s Guide)

    Line 79-90 handles creating the options in the dropdown.

    If you add a piece of code like this right after the foreachin line 79, that will remove the two columns from the dropdown as well as from the table.

    <?php if( $column_slug == "category" || $column_slug == "end_date" ) continue; ?>

    Note, category and the end date will still be visible in the code, but not accessible via the UI.

    If you want to make it disappear from the code as well, then you will need some further customization later in the code.

    Hope this gets you started. Let me know if you need further guidance.

    Cheers,
    Andras

    #1391861
    Sean
    Participant

    Good morning András,

    Thank you very much for this snippet as well as the detailed explanation of where to place the code and what it will do. It is exactly what we needed!

    Thanks again and happy holidays!
    Karly

    #1392181
    Andras
    Keymaster

    Hope you had a great thanksgiving. I’m stoked to hear it worked for you!

    Since this is resolved I am going to close this ticket, but if you need anything else related to this topic or another please create a new ticket and we’ll be happy to help.

    Cheers,
    Andras

    PS: If you like our plugins, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
    https://wordpress.org/support/view/plugin-reviews/event-tickets/

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Set Default Columns on My Events page’ is closed to new replies.