Posted: July 22, 2015 at 9:21 am
|
See screenshot Hello, I am using EE3 and customizing the “events-table” addon. The code I am using to try and display the price is: Can you tell me what code will correctly display the events price? Also, How can I display each event description? Thanks! |
Hi Judy, Within the events-table template this: echo $event->event_cost; Should output the price for the event. Looking at the example you’ve posted above the reason it isn’t working is due to using $event_id, that variable isn’t setup within the template (unless you have done so yourself), you’ll want to use something like:
|
|
|
Perfect, that worked wonderfully, any chance there is a similar way to output the event description? Many thanks! |
If you use: var_dump($event); Within that template you can see all the values set within $event, for description you use $event->event_desc I would recommend using the espresso_format_content() function to format the output correct, like so:
|
|
|
Thanks again, worked like a charm! I am using the Staff Manager with EE3, I would like to output the staff I have created and assigned to each event on the template shown above, I attempted to use this code: <?php echo do_shortcode(‘[ESPRESSO_STAFF event_id=”‘ . $event_id . ‘”]’); ?> However nothing is showing, I am not very good with php so I am just trying to work with examples to pull this off. Is there something I need to define within my template again to make that shortcode work?? Also, will the staff that is displayed link to that persons page (if any?) Thanks again, you’ve been a huge help! |
That’s likely the same issue as the first example. $event_id is a variable that hasn’t been set within the template. Change that from $event_id to $event->id
No, that shortcode will output a list of details set within the staff manager for the member you have assigned to the event.
|
|
|
is there any code to only display the staff persons name and exclude all other information? |
|
sorry, figured this out using short code parameters. |
I’m glad you got it figured out 🙂 There is a list of all of the available shortcodes and variables available within EE3 here: https://eventespresso.com/wiki/shortcodes-template-variables/ |
|
The support post ‘Code to display price & description?’ 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.