• Hello.

    Love the plugin ??

    Is there any way to filter on location? or have the pro filter prefilled and hidden?
    Or any other idea ??
    E.g. I just want to show the events that have location “Gunnevi*” in the calendar.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author room34

    (@room34)

    Yes, although it does require a bit of PHP code:

    https://icscalendar.com/developer/#r34ics_display_calendar_exclude_event

    You can replace summary with location and you’ll need to change !== to === to exclude events that do not include the string you’re matching.

    • This reply was modified 1 year, 4 months ago by room34.
    Thread Starter grolken

    (@grolken)

    Thanks for quick response.

    There have been some wishes that we have buttons with the different locations that shall be filtered.

    <html>
    <head>
    <script>
    function fillTextbox() {
      document.getElementById('ics-calendar-filter-text').value = 'Sk?llinge IP';
    }
    </script>
    </head>
    <body>
    <button onclick="fillTextbox()">Sk?llinge IP</button>
    </body>
    </html>

    I′m trying to fill the textbox but it′s not working.

    You have any idea?

    Plugin Author room34

    (@room34)

    @grolken I’m sorry, but the filter is a feature of the Pro version of the plugin, so I’m not allowed to provide support for it in these forums. Please use the Pro Support Request form. Thanks.

    Thread Starter grolken

    (@grolken)

    Hi.

    Tried to add this code, but nothong happends.

    Put it in my themes functions.php also tried a code snippet plugin.

    add_filter('r34ics_display_calendar_exclude_event', function($exclude, $event, $args) {
    if (stripos($event->location, 'Sk?llinge IP') === false) {
    $exclude = true;
    }
    return $exclude;
    }, 10, 3);

    Edited:

    Noticed that it worked in month and listview, but not in basic view.

    • This reply was modified 1 year, 3 months ago by grolken.
    Plugin Author room34

    (@room34)

    This filter applies to all views. My best guess is that your site already had the basic view cached. Try the Clear Cached Calendar Data tool on the ICS Calendar admin page and then view the basic calendar again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Filter location’ is closed to new replies.