Events Made Easy Forums How do I … Use short code instead of a widget

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #43868
    Anonymous
    Inactive

    Hello Franky,

    Sorry to trouble you.

    Is it possible to use a short code instead of a widget?

    This is the code that I use in the widget:

    <table class=”ShortCourseListing”> <thead> <tr> <th>Centre</th><th>Course Dates</th><th>Assessment Date</th><th>Assessment Location</th></tr></thead><tbody>

    <tr><td>

    #_LOCATION</td><td>

    #_{j M Y} [events_if tag=”#ESC_{j M Y}” notvalue=”#ESC@_{j M Y}”] #@_{- j M Y} [/events_if]</td>

    <td>#_ATT{assessment_date}</td><td>#_ATT{assessment_location}

    </td></tr>

    </tbody></table>

    Many thanks for your time.

    #50004
    Franky
    Keymaster

    Do you mean “shortcode inside a widget”? Yes, that’s possible, see the EME settings (search for widget).

    #50005
    Anonymous
    Inactive

    Hi Franky,

    No – Can I use the above short code without using it in a widget.

    #50006
    Anonymous
    Inactive

    Or better still can I do it using php in my template?

    #50007
    Franky
    Keymaster

    If using this directly in php, you need to call a EME function to interpret it all, otherwise you have nothing. Look at calling eme_replace_placeholders() directly (with the correct parameters: format, event)

    #50008
    Anonymous
    Inactive

    Hello Franky,

    I managed to get it working using this as the short code

    <table class=”ShortCourseListing”><tr><th>Centre</th><th>Course Dates</th><th>Assessment Date</th><th>Assessment Location</th></tr>[events_list category=12 limit=0 format="<tr><td>#_LOCATION</td><td>#_{j M Y} -#ESC@_{j M Y}</td><td>#_ATT{assessment_date}</td><td>#_ATT{assessment_location}"]</td></tr></table>

    But, if I have an event on a single day it shows the same date twice.

    In my widget code I use the following between my td tags

    #_{j M Y} [events_if tag="#ESC_{j M Y}" notvalue="#ESC@_{j M Y}"] #@_{- j M Y} [/events_if]

    When I use this coding in my short code it throws everything out?

    How can I use the short code to remove the duplicate date if the event is only on one day?

    Many thanks in advance.

    #50009
    Franky
    Keymaster

    I think I’m a bit confused here. Where exactly are you typing this in?

    #50010
    Anonymous
    Inactive

    On a page

    #50011
    Franky
    Keymaster

    Directly in a page? There the conditional tag is not supported … it only works correctly in the format settings of EME.

    #50012
    Anonymous
    Inactive

    I was originally using a widget to put the codes on different pages, but to save time (as I have lots of categories, I thought it might be easier to use short code (copy and paste) and just change the category id for each page. Everything works okay except when I have an event on a single day – it shows the start date and then a duplicate date as the end date. The code (above) works okay if its in a widget, but doesn’t work if used on a page.

    #50013
    Anonymous
    Inactive

    If I put this code in a widget it works okay on a page

    #_{j M Y} [events_if tag=”#ESC_{j M Y}” notvalue=”#ESC@_{j M Y}”] #@_{- j M Y} [/events_if]

    So would it work if I ceated a template for each category using php coding?

    #50014
    Franky
    Keymaster

    if using php coding, why not just use php to compare date/time values of beginning and end?

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top