New Template (not override)

Home Forums Calendar Products Events Calendar PRO New Template (not override)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1260814
    Chad
    Participant

    Hello,

    I am attempting to create a template to contain a print-friendly version of a list view of my calendar. My list view also contains a few custom fields using (ACF) and I want it to only display a specific week.

    Note: I do not want to override an existing template. I want to create a new one.

    My approach was:

    1) copy src/views/list/* to my-child-theme/tribe-events/list-print/ directory.
    2) create a new standard WordPress template, moving the content from src/views/list/content.php into WordPress template, and changing all instances of tribe_get_template_part so that

    tribe_get_template_part( 'list/nav', 'header' )

    becomes

    tribe_get_template_part( 'list-print/nav', 'header' )

    The page is displaying the basic event information, but the venue information doesn’t seem to be populating.

    I’m wondering:
    1) what is the correct way to create a WordPress template (not page or post) that contains a list view which I can style for print and
    2) if there is a better way of accomplishing this?

    BTW – I first attempted shortcodes but they don’t use my ACF fields and are limited in filtering options.

    Thanks for your help!

    #1261594
    Victor
    Keymaster

    HiĀ Chad!

    Thanks for reaching out to us! šŸ™‚

    While our ā€œTerms of Serviceā€Ā doesnā€™t allow us to do customizations, we do like helping out and at least point users into the right direction. That said, let me try to help you with this.

    what is the correct way to create a WordPress template (not page or post) that contains a list view which I can style for print and

    You could start by creating a new template page for your themeĀ and thenĀ construct a custom query of events in it, either usingĀ tribe_get_events() as the basis of the query, or the default WordPress get_posts() function in which you would make a calle for theĀ tribe_events post type

    Additionally, there is a good article on creating print styles for WordPress here >Ā https://codex.wordpress.org/Styling_for_Print

    I hope that helps. Let me know if any other questions.

    Best!

    Victor

    #1261675
    Chad
    Participant

    Thanks Victor. tribe_get_events() is definitely the easy way to go. Looks like it hooks into the WP post data as well – I was able to pull my ACF in the loop.

    Thanks!

    #1261723
    Victor
    Keymaster

    Hey Chad!

    That’s great! I’m super happy you could work it out šŸ™‚ Thanks for coming back and lettingĀ us know about it.

    I’ll close this thread now but please feel free to open a new one if any other questions.

    Good luck with your project!

    Victor

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘New Template (not override)’ is closed to new replies.