Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter eventiatmilano

    (@eventiatmilano)

    Hi Darian,

    thank you for your support.

    To check the active ‘view’ and apply the corresponding logic, do I have to use a function that checks the page URL? Or is there some specific function in The Events Calendar that allows me to test whether I am in the ‘month’, ‘list’, etc. view?

    I know about tribe_is_month() function, but I do not know if it can be used with ‘v2’ views.

    I have activated a snippet on my staging site that should allow a different H1 tag to be displayed, depending on the page: you can download it at this link.

    This snippet use add_action( ‘tribe_template_before_include:events/v2/components/events-bar/search/keyword’, ‘set_page_H2_tag’, 15, 1);

    I do not understand why on this page (for the event category “teatro”) the H1 tag, with text “Prossimi eventi a Milano” is placed inside the search bar, instead of before the search bar!

    Can you tell me how to solve this problem?

    Thanks a lot, have a nice day,

    Paolo

    Thread Starter eventiatmilano

    (@eventiatmilano)

    Hi Darian,

    How can I tell if I am on the https://eventiatmilano2.netsons.org/eventi/categoria/concerti/elenco/, o nella pagina https://eventiatmilano2.netsons.org/eventi/categoria/concerti/ or on the page https://eventiatmilano2.netsons.org/eventi/categoria/concerti/mese?

    I need to apply business logic that varies according to the ‘view’, but I have no idea how to check the active ‘view’ on the page.

    And above all, what happens when the user clicks on the ‘List’, ‘Month’ or ‘Day’ buttons? Is the active ‘view’ updated?

    Thanks for the support,

    Paolo

    Thread Starter eventiatmilano

    (@eventiatmilano)

    Hi Darian,

    Thank you for your reply, I will try to add the necessary clarifications below.

    I have listed the two changes I would like to make directly in this screenshot.

    In the event category pages, I would like to insert a single H1 tag, valorised using a prefixed text, following the string ‘X’ (where ‘X’ is the name of the event category): so in general we will have H1 equal to ‘X a Milano: eventi in città e dintorni’.

    For simplicity, let us look at the changes for a specific page:

    1. For the event category ‘Concerts’, I would like to keep only the H1 tag with a red background, and I would like it to have exactly the following “title” in the upper section: ‘Concerti a Milano: eventi in città e dintorni’ (without any newline character after the word ‘Concerts’).
    2. For the event category ‘Concerts’, I would like to delete the word ‘Concerts’ in the H1 tag which is located just above the calendar.

    By implementing the changes described above, event category pages would also have the same layout as event pages (e.g. this one), with the “title” inside the H1 tag in the red band at the top.

    Thank you again for your helpful support!

    Regards,

    Paolo

    Thread Starter eventiatmilano

    (@eventiatmilano)

    Thank you Brook,
    I try to explain myself another time.
    Many art exhibits runs for months, so imagine an exhibition start on 1st January 2016 and ends on 30th April 2016.

    Today is 28 march 2016: so in event list page (www.eventiatmilano.it) I would see the following list for upcoming events

    GENNAIO 2016
    Exhibition that start on 1st January

    FEBBRAIO 2016
    Exhibition that start on 1st January

    MARZO 2016
    Exhibition that start on 1st January + other events

    and so on.
    I would like to see the CORRECT DATE for this exhibition in ‘Upcoming Events’. I think is not so useful to see the oldest start date of a currently running event. I think today, 28th march 2016 people really don’t want to see January in “upcoming events”.
    Perhaps they want to see the below list:

    MARZO 2016
    Exhibition that start on 1st January + other events

    APRILE 2016

    and so on.
    In other words, for an event that spans several months, I would like to show the events in the list and not hide them, but have the month reflect the current month instead of the month it started.
    Understand, now?

    Thank you for your support
    Paolo

    Thread Starter eventiatmilano

    (@eventiatmilano)

    Thank you, joinfof.
    As I told before, my goal is not to hide events that have already started.

    My goal is this: for event that span several months, I don’t want to see even OLD MONTHS in my upcoming event list. I want to see an event that has already started, but with the correct date.

    I’m reading threads you link me, hope to find something useful for me.
    Cheers
    Paolo

    Thread Starter eventiatmilano

    (@eventiatmilano)

    Thank for your response.
    I think there is a misunderstanding here: if I create an event that start on 03/01/1999 and ends on 05/07/2016, I see in event list page the follow list:

    GENNAIO 1999
    Event that is still ACTIVE

    FEBBRAIO 2016
    List of events

    MARZO 2016
    List of events

    … and so on.
    Perhaps (I’m not sure) the problem is in line 338 of file loop.php located in path /the-events-calendar/src/functions/template-tags/

    /*
    * If the event month changed since the last event in the loop,
    * or is the same month but the year changed.
    *
    */
    if ( $wp_query->current_post === 0 || ( $prev_event_month != $event_month || ( $prev_event_month == $event_month && $prev_event_year != $event_year ) ) ) { $html .

    Why don’t you compare date in this IF clause with “current date”? If my event span several months, I don’t want to see even OLD months in my upcoming event list. Understand?

    Thanks in advance
    Paolo

Viewing 6 replies - 1 through 6 (of 6 total)