Okay
  Public Ticket #2303024
RSVP view
Closed

Comments

  • const_ant started the conversation

    Hi, how can I create an agenda view with a list of events only I'm attending? 

  •  894
    Zhivko replied

    Hi,

    Currently there's no built-in filter for this. 

    You can add custom filter by inserting following code in your theme functions.php file:

    add_action('stec_after_html', function() {
        ?>
        <script type="text/javascript">
            (function ($) {
                $.stecExtend(function (m) {
                
                    if (parseInt(m.glob.options.attending, 10) !== 1) {
                        return;
                    }                 var filtered = [];
                    var events = m.calData.eventsPool;                 $.each(events, function () {
                        var event = this;
                        
                        if (this.attendance.length <= 0) {
                            return true; // continue;
                        }                     $.each(this.attendance, function () {
                            if (this.userid === m.glob.options.userid) {
                                filtered.push(event);
                            }
                        });                 });                 m.calData.eventsPool = filtered;             }, 'onAddToEventsPool');
            })(window.jQuery);
        </script>
        <?php
    });

    Then in your shortcode add following parameter: attending=1. Example:

    [stachethemes_ec attending=1]

    Stachethemes Developer

  • const_ant replied

    Works perfect, thank you! Think of including it in the standard bundle