Support

Home Forums Event Espresso Premium Messages: Shortcode to display only first datetime of series.

Messages: Shortcode to display only first datetime of series.

Posted: April 13, 2016 at 1:45 pm


Amanda

April 13, 2016 at 1:45 pm

I have events in EE that have a series of meetings. I would like to insert the datetime_start of only the first meeting of the series into the text of my registration confirmation email.

I’ve made a custom template and I’ve inserted custom text into the [event list] section–I tried to use “[datetime_start limit=1] but that didn’t work.

Is there a way to do this?

Thanks, Amanda


Garth

  • Support Staff

April 13, 2016 at 3:45 pm

Hi Amanda,

That’s a nice guess, but the [DATETIME_START] shortcode has no additional parameters. You would have to enter/type/add the datetime information statically to the custom message notification if you don’t want the full list, that way it will only show the one you want.


Amanda

April 13, 2016 at 5:16 pm

The only trouble with that approach is that I have a whole category of events that I want to use this particular custom template with and not all of them start on the same day. I can probably work around this, but it would be handy to have that capability.

Thanks,
Amanda


Josh

  • Support Staff

April 13, 2016 at 5:50 pm

Hi Amanda,

Another approach would be to input the date you want to be displayed in a custom field in the event editor. Then you can display the custom field value with the [EVENT_META_*] short code in the [EVENT_LIST] section of the email.


Amanda

April 14, 2016 at 10:33 am

Hi Josh,
As it happens, I already have a custom field in these events. I tried inserting [EVENT_META_*]–it returned “array” in the email.


Amanda

April 14, 2016 at 10:49 am

Hi Josh,
It occurred to me–I can use the [EVENT_EXCERPT] tag, since I’m not using it for anything else. That works.


Amanda

April 14, 2016 at 10:55 am

Is it possible to have more than one custom field in the event editor? And to specify which field will show in the [EVENT_META_*] ?


Tony

  • Support Staff

April 14, 2016 at 11:05 am

Hi Amanda,

Yes you can.

The _* shortcodes are all dynamic shortcodes (there’s a few different types of _* shortcodes in EE) meaning you can do something like this:

[EVENT_META_*custom-meta-key]

and EE will parse to the custom meta value for that key. Note the key must match exactly.


Amanda

April 14, 2016 at 11:34 am

Is the key the same as the field name?


Amanda

April 14, 2016 at 11:39 am

Never mind–I tried it and it works!


Tony

  • Support Staff

April 14, 2016 at 11:49 am

Yes within the custom fields the ‘Name’ field is the key, the value is… well the value for that key 🙂

If you have any further questions just let us know.

The support post ‘Messages: Shortcode to display only first datetime of series.’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso