• Resolved undoproject

    (@undoproject)


    Hi All,

    Can someone tell me what the easiest way is to customize the formatting of an event list?
    I have events which have 6 types of tags. I need lists filtered to these tags and I need a complete list which holds all the events.
    Creating the lists is easy with the tag attribute, but I need different formatting.
    In the complete list, I’d like to place an icon corresponding to the type of event.
    In the tag filtered lists, I don’t want to place icon.
    So, is there any way to pass a variable in the shortcode or should I write a custom shortcode for this?

    Thanks,

    Sabi

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    You would need to do some custom coding to achieve your goal. Here are links that would help you get started.

    https://wp-events-plugin.com/documentation/shortcodes/
    https://wp-events-plugin.com/documentation/placeholders/

    You can use shortcodes to create a list that is filtered with a specific tag. Example below.

    [events_list tag="TAG_ID"]#_EVENTNAME <br/>[/events_list]

    If you want to pass variables, What you might is to use PHP GET and add those in a URL.
    https://example.com/some-link/?tag-id=10

    Alternatively, You could always redirect them to a tag page which is already built-in on EM. Events > Tags > Click view on TAG

    Thread Starter undoproject

    (@undoproject)

    Thanks for the reply @timrv !
    As I wrote filtering is not a problem.

    The problem is the conditional formatting. It’d be nice to use only the shortcode to pass e.g. a boolean value and use it as a conditional placeholder. If it is false (or 0) then I don’t display icons at the end of the table row. If it is true then I put one.

    On my site, all the events can have multiple tags that’s why I can’t use the URL.

    I was thinking to use the “format” attribute in which I’d link a php or html file. Therefore I’d use two kinds of and link the corresponding one on the suitable page.
    Can be done with the “format” attribute? Is so is there an example?

    I’ve already created a php file and put it into the my_template/plugins/events-manager/templates/formats/ folder but nothing happened.

    Thread Starter undoproject

    (@undoproject)

    Ok, I made it, actually it was far easier then I thought.
    No need to code, change php or passing any parameter. You can customize the list between the shortcodes. The only drawback is if you have a complex table format (as I do) with plenty of conditional parts, then you have to deal with the thing without using any white space or line breaks in the editor.
    For this scenario, it’d be useful to pass a format php / html in the shortcode. I tried it without any luck I’d love to know why I failed.
    So if someone has a working example share it with me pls!

    sorry

    @undoproject : So how did you solve the conditional part for the six tags with different icons in your complete list? Could you add the event-list format you use now to this post? Would be interesting for others as well.

    Thread Starter undoproject

    (@undoproject)

    @pferdetermine, as I mentioned the shortcode looks a complete mess without proper text formatting, and it is also long as hell, so I wouldn’t bother posting it here.

    I needed a list in a table that’s why there’s a Raw HTML block right before the shortcode: <table><tbody>

    shortcode in a normal Text Block:
    [events_list]<tr><td class=tdDate><b>#_EVENTDATES</b>{has_time}#_24HSTARTTIME{/has_time}</td> … {has_tag_ID1}<td class=ID1>…placing the icon…</td>{/has_tag_ID1}…</tr>[/events_list]

    Worth to mention: in the Text Block you can’t use quotation marks for CSS, Tag or other ids.

    There’s a Raw HTML block right after the shortcode:
    </tbody></table>

    Hope that helps.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom event lists, formats’ is closed to new replies.