Support

Home Forums Event Espresso Premium Adding Spaces Available to Custom Template

Adding Spaces Available to Custom Template

Posted: August 26, 2014 at 5:16 am

Viewing 10 reply threads


ali west

August 26, 2014 at 5:16 am

Am trying to add the available spaces to a custom template, having used a predesigned template which showed the venue and dates which I don’t want. I just want the title, availability and register button.

If I copy the code the firewall blocks it but the page I am developing is here if that helps:

http://www.beachvolleyballinc.com/NEW/coaching-and-camps/availability

I’d like it to show either 2/10 under an attendees title or else 8 under a spaces available title.

All ideas welcome!


Dean

August 26, 2014 at 6:06 am

Hi,

In the code you could use the shortcode [ATTENDEE_NUMBERS], such as :

echo do_shortcode('[ATTENDEE_NUMBERS event_id="'.$event_id.'" type="num_attendees"]');?> / 

Check the documentation for more parameters: https://eventespresso.com/wiki/shortcodes-template-variables/#attendee-numbers

Also, if the code is being blocked, please use a service such as Pastebin.com


ali west

August 27, 2014 at 7:26 am

thanks for that. i did try it but it just comes up with 0 for every entry even though there are registered attendees. here’s my page code: http://pastebin.com/xyJ7CDpT


Tony

  • Support Staff

August 27, 2014 at 10:06 am

The reason for this is the template does not have an $event_id variable which is used within the code Dean provided.

You’ll need to swap out both instances of $event_id in that code for $event->id


ali west

August 28, 2014 at 1:53 am

thanks tony but it still shows 0 for each one. in the system some of the camps have attendees registered and paid?


Dean

August 28, 2014 at 4:38 am

Hi,

The change to $event->id made it work: http://take.ms/kkVHv

“in the system some of the camps have attendees registered and paid?”

I assume by that, that at least some attendees have been marked as complete in the admin area?


ali west

August 28, 2014 at 4:56 am

hi dean
hmmm not sure why it works for you but not me. yes the attendees have been marked as complete in the admin area.. i.e. they have a green circle with a tick in in the status column?


Dean

August 28, 2014 at 5:59 am

Yep, green and round is good.

I double checked it and it’s definitely working. Did you definitely modify the $event_id in the shortcode to $event->id?

That’s the only reason I can think why it won’t work.


ali west

August 28, 2014 at 6:54 am

hmm i changed this bit, was there anywhere else i needed to change?:
<td id=”venue_title-<?php echo $event->id?>” class=”venue_title”><?php echo do_shortcode(‘[ATTENDEE_NUMBERS $event->id=”‘.$event->id.'” type=”num_attendees”]’); ?></td>


Dean

August 29, 2014 at 1:26 am

Hi,

It should read:

event_id=”‘.$event->id.'”

so just the variable that gets changed not the parameter name.


ali west

August 30, 2014 at 2:44 am

ahaaaa! that worked a treat, thanks dean 🙂

Viewing 10 reply threads

The support post ‘Adding Spaces Available to Custom Template’ 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