• Resolved bszakacs

    (@bszakacs)


    Hi

    I am having a problem with inserting date related placeholders into listing headers. To be more specific, the “Default event list format header” textarea, and nor the template file itself, does not handle date formatting variables like #d or #M.

    How can this be fixed as i need to insert variables there.

    Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • Try going to Events Manager Settings and then click on the Formatting tab and then click on Date/Time to set the date format.

    Thread Starter bszakacs

    (@bszakacs)

    You misunderstood. I mean the event list format header, not the groped header. See this screenshot:
    https://prnt.sc/_bopQ-szk_VD

    The middle textarea accepts php date formattings like #d or #M, but the upper one, i marked with red, doesn’t.

    Is there any fix for this?

    The default event list format header goes above the entire event list so it doesn’t make sense to put a date there.

    Thread Starter bszakacs

    (@bszakacs)

    But i am making some personalized tabbed solution, and i need this option there. Anyway i can edit the plugin – even on a code basis – to make this renderable and doable?

    I don’t know what you’re trying to do. What do you expect #d and #M to render when you place it in the header section of the default event list? The header section goes above the event list and is not associated with a single event. So, what date should be displayed there?

    Thread Starter bszakacs

    (@bszakacs)

    I am trying to achieve horizontal tabs, not vertical, and for this i need to list the active (fullfill) days above the actual listing. As in the event list page, you cannot list fullfill days with a shortcode, i wanted to add the day tab inside the loop, than move it with jquery outside it, to the tabs container. But the tab and the tab content ID must match, and this is where i wanted to add the day date – like tab-“22”, where 22 is the day after the events are grouped – , but also keep group list header separate, as that is where i can actually display “august 22.”

    As i don’t want empty tabs, i need to list only fullfill days according to the current listing (by category, ba location, all events etc), but there’s no such option. So i tried to do it with tricks.

    Hard to explain, indeed, but result is nice.

    Thread Starter bszakacs

    (@bszakacs)

    Simply to say: when events are grouped daily, i need to pass the current day date number to both the Group list header, as well to the Event list format header. Than i can use that as an ID to communicate between tabs and tab content.

    Or, if using the php templates, i need to pass the same incrementing variable to event_list_item_format_header.php and event_list_item_format.php from events-list-grouped.php. But latter uses echo for this function:
    EM_Events::output_grouped($args)
    which has no option to pass variables or to catch the loop.

    • This reply was modified 1 year, 7 months ago by bszakacs.
    • This reply was modified 1 year, 7 months ago by bszakacs.
    Thread Starter bszakacs

    (@bszakacs)

    Hi

    I managed to do what i needed by editing “classes/em-events-php” and adding array of “str_replace” in function “output_grouped”.

    Question: is there any way to override “output_grouped” function from functions.php, as now i edited the plugin, and lost upgradability.

    Thanks

    • This reply was modified 1 year, 7 months ago by bszakacs.

    You could use the em_events_output_grouped filter to override the output of the function output_grouped.

    add_filter( 'em_events_output_grouped', 'my_em_output_grouped', 20, 3 );
    function my_em_output_grouped( $EM_Events, $output, $args) {
         // write your own code to generate the result
         return $output;
    }
    Thread Starter bszakacs

    (@bszakacs)

    Thanks a lot!

    As a suggestion, you could add the option to call fulfill days shortcode, to be able to create a proper horizontal tabs display. This way the days, as tab headers could be in a separate loop than the tab contents – the events list.

    I don’t own this plugin so I have no way to make that change. I also don’t know what you mean by “add the option to call fulfill days shortcode”. Do you mean add an option to one of the existing shortcodes?

    Thread Starter bszakacs

    (@bszakacs)

    Yes, exactly. That’s what i wanted to suggest.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Date variables in header and footer fields’ is closed to new replies.