different html before specific views, on view by view basis?

Home Forums Calendar Products Community Events different html before specific views, on view by view basis?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1314761
    Lou
    Participant

    I need to have some text before the month view and different text before the community events add view. I got very excited when I saw The Events Calendar Extension: Selectively Show HTML Boxes, but when I tried to use it was disappointed that the html cannot be controlled on a view by view basis.

    I can add html before the month view using settings>display, and before the community events add view in my theme using (maybe) the tribe_events_community_section_after_title action, but then I’m coding into my theme the text to display. (BTW, where is the documentation on available actions?).

    Note when I finally deploy Community Events, I need to change the text above the month view to point new users at the community events page, so would prefer not to harden that aspect of this into my theme.

    Is there any, perhaps more elegant, solution to what I’m trying to do?

    #1315620
    Andras
    Keymaster

    Hi Lou,

    Thanks for reaching out!

    I’m not quite sure which extension you mentioned as I didn’t find that in our extensions library.

    However, there is this one that allows you to add custom HTML content to the top of the Community Events submission form.

    Does this help?

    Cheers,
    Andras

    #1315623
    Lou
    Participant

    Yes I’m talking about https://theeventscalendar.com/extensions/display-custom-html-specific-calendar-views/ . When installed it shows up as “The Events Calendar Extension: Selectively Show HTML Boxes” in the plugins list.

    With this extension I can set the html before the month view, or set the html before the community event edit view using Events > Settings > Display > Advanced Template Settings > Add HTML before event content. Actually there’s a set of checkboxes after “Show HTML before on” and I can set the same html before multiple views.

    Problem is I need the html before month view to be different from the html before community event edit view. So I guess I need to use the solution I mentioned.

    Also can you tell me where is the documentation on available actions, like tribe_events_community_section_after_title?

    #1315772
    Andras
    Keymaster

    Hi Lou,

    Thanks for getting back to me on that.

    At the moment we don’t have documentation available for hooks and filters. That is something we are working on, but don’t know when it is going to be ready.

    We do have documentation for the functions in the plugins which you can find here.

    As for the separate HTML on the community events submit form, I believe your best bet would be creating a template override for that page / file. Our Themer’s Guide will give you the basics on how to create a template override.

    You will need to create an override for this file:

    wp-content\plugins\the-events-calendar-community-events\src\views\community\modules\title.php

    And the other option would be via a snippet in your functions.php file, which can possibly check for the view you are looking at and showing different texts based on that, but that would be hardcoded.

    With some more work this could be pluginized.

    Another alternative I can suggest is putting all the texts in the before HTML fields surrounded by divs or spans with different class name. And based on the view you can show / hide the different classes. Though this would likely influence SEO a bit.

    Do any of these help?

    Andras

    #1315773
    Lou
    Participant

    I hadn’t considered the last alternative of different classes which are controlled by view. This seems the best way to go for me, as the text is then configurable rather than hard coded in functions.php or the template.

    Thanks!

    #1315777
    Andras
    Keymaster

    You’re welcome, glad I could give some ideas to move you forward with this.

    Since you marked this resolved I am going to close the ticket. If you need anything else related to this topic or another please post a new one in the forum and we will be happy to help you out.

    Good luck with your project!

    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/plugin/the-events-calendar/reviews/

    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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘different html before specific views, on view by view basis?’ is closed to new replies.