• Hi All,

    have anyone tried the format parameter in the events_list shortcode?
    Is there a working example I can have?
    I’ve followed the docs, instructions without success. Would be really helpful for me to keep all the custom list formats in external files.

    Cheers,
    S

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi ??
    The format is pretty easy to use.
    [events_list] shows a list with formatting as set in the settings Formatting > Events > List formatting.

    [events_list format=”#_EVENTNAME”] keeps the rest of the arguments (like default scope), but overwrites the list content and removes the list header and footer.

    [events_list]#_EVENTNAME[/events_list] does exactly the same as the previous.

    [events_list format_header=”HEADER”] replaces the default list header as set in the settings.

    Personally, I find using [events_list]My new markup[/events_list] the easiest to use (and remember). ??

    Thread Starter undoproject

    (@undoproject)

    Hi @duisterdenhaag,

    thanks for the reply. Let me explain why I need external files.
    I need to display the event info in tables. It looks better, handling is easier.
    I have to display content based on different conditions. I have different use cases, every page has it’s own different event lists.
    So, it’be very inconvenient passing a really long format as a parameter in the shortcode.
    I did it though and lost the format header and footer. A table needs header / footer so I put these as a raw HTML code to the page. But it doesn’t work that way either because it’s losing the proper class definition and at the end, it is misformatted.
    So I think external formatting files would be the best for me, but if you can tell me how to solve this table misformatting thing I’d be grateful.

    Hello,

    Sorry but I’m confused with what you’re after. The [events_list] doesn’t use any template files. It’s very flexible that you could just throw the html tags and use the placeholders/custom placeholders that you need. If you want to use it inside the external files, you could always use the do_shortcode of WP to echo the [event_list] shortcode.

    The format parameter lets you add a header/footer formatting or use the default one that is supplied on your Settings.

    You could also skip the format attribute and just do something like the following example below.

    <ul class="events-list">
    [events_list]<li>#_EVENTNAME</li>[/events_list]
    </ul>
    <table class="events-list">
    <thead>
    <tr>
    <th>EVENT NAME</th>
    <th>EVENT DATE</th>
    </tr>
    </thead>
    [events_list]<tr><td>#_EVENTNAME</td><td>#_EVENTDATES</td></tr>[/events_list]
    </table>
    • This reply was modified 6 years, 1 month ago by timrv.

    External php files will not work, because you can never embed those in a shortcode from the WP Admin.
    Perhaps you should forget using the EM shortcode all together and use custom coding, outside of Events Manager. Shortcodes are meant to be “a convenient way of displaying events”. ??

    You will need to create the code somewhere in order for it to be read and outputted to the browser. LOL. If the table layout is the same, but the content differs, you might want to take a look at the conditional placeholders. You can embed multiple levels of conditions if needed.

    If certain layout and contents are repeated, you could also create custom placeholders for that. Then use those within the shortcode:
    [events_list]#_MYCUSTOMPLACEHOLDER[/events_list]

    I have different use cases, every page has it’s own different event lists.

    Could you explain that a bit further, please? It does not sound like a mainstream set-up. Are we still talking about lists showing multiple events or single event pages??

    Perhaps some examples to give me/us an idea?

    Thread Starter undoproject

    (@undoproject)

    Thanks for both of you.

    This is my use case:
    Every event has tags, which show is performed, ticketed or not, sold out or not…
    On some pages, there’s no need to display the show tag. For example: https://bandart.hu/en/#showsOnTour see the three lists below the “Next date” sections.

    There’s a page where I have to display the title of the show for the corresponding event:
    https://bandart.hu/hu/fellepeseink/

    The first example works just fine. If you check the second example (the one in Hungarian) and resize the browser as much as you can (phone resolution) you’ll see that the last column is off the visible area. That is how I realized that no matter how I tried to put the table header and footer to the shortcode the table definition is fallen apart.

    • This reply was modified 6 years, 1 month ago by undoproject.

    Aha… I think I’m starting to get it.

    Okay, the layout thing is simply because you are you using tables. Tables are not very responsive by nature, so it’s better to use divs instead. Those you can assign they have to act like a table if the screen is wide enough and behave differently on smaller screen (collapsable) – you will need to use css media queries for that.
    Here’s a good read about that:
    https://css-tricks.com/accessible-simple-responsive-tables/

    Also, you mentioned you are using tags. Tags have to be maintained manually. Sounds like a lot of work to manually set a concert to “past” or “sold out” when EM can do that for you.
    And tags are mostly used for search results: “I want to see all posts containing ‘apples'” ??

    If you assign a complete tour to a dedicated event category (say: “Anndroid-2019″) then you can use that Category ID to filter everything else.
    [events_list category=”12″ scope=”future”] will output only upcoming events for that artist/tour, but still use the general mark-up so all those lists on your site look the same. (Your first example)

    In your mark-up you can use conditional placeholders, like {fully_booked} or {is_past} to show different content. A good example of using conditional placeholders ca be found here: https://www.stonehengecreations.nl/create-google-structured-data-for-events-manager/

    Example:
    [events_list category="12" scope="all"]{is_past}#_EVENTDATES is passed.{/is_past}{fully_booked}Sold Out!{/fully_booked}{has_spaces}Buy your Tickets NOW!{/has_spaces}[/events_list]

    Makes sense? ??

    Here’s the EM help file for conditional placeholders:
    https://wp-events-plugin.com/documentation/conditional-placeholders/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Events_list format parameter’ is closed to new replies.