Support

Home Forums Event Espresso Premium Display Question Results On A Page

Display Question Results On A Page

Posted: January 9, 2015 at 7:03 am

Viewing 17 reply threads


Guvnor

January 9, 2015 at 7:03 am

Hi,

I’m running EE4 right now and I have created some custom questions for the registration form. What I’d like the ability to do is display the question results on a webpage. Here’s the questions:

1)Year, 2)Make, 3)Model, 4)Engine.

As this is for a car show, what this will do is show the type of vehicles that will be appearing at the show based on paid registrations. I’m sure this is an easy one for you guys but as I am no developer and I don’t want to go hacking into the EE code, just wondered if anyone has a quick way to do it.

Thanks

~R


Guvnor

January 10, 2015 at 1:35 pm

Just to help out the person who is going to answer my request, the answer ID’s are 11,12,13 & 14.

Problem is is that this site goes live in 24 hours! HELP ๐Ÿ™‚


Dean

January 12, 2015 at 12:33 am

Hi,

Sorry for the delay in getting back to you, support is limited on the weekends.

So, if I understood correctly, you want to list out the answers for all the attendees custom questions, kinda of like a table compiling all the answers together?

If so, it can be done but would require custom development as this isn’t a feature in EE.

You would need to query two database tables (esp_registration to get the ID’s of the attendees for the event, and esp_answer to get the actual answers) and then collate the data and display it via a shortcode or page template.

We have a list of recommended developers here: https://eventespresso.com/developers/event-espresso-pros/


Guvnor

January 12, 2015 at 4:31 am

Hi Dean,

You’re close, all I want to do is list the answers only in a 4 column format, no attendees at all. So just pull from one table in the database, not 2.

Thanks

~R


Dean

January 12, 2015 at 5:16 am

Hi,

You will still need to pull the data from both tables, as you will need to get the attendees for the event first and then match them up with the answers table, otherwise your data might end up using data from different events.

This is something that is outside the scope of support to create, but a developer should be able to create a basic shortcode quite easily.


Guvnor

January 12, 2015 at 5:43 am

Hi Dean,

Its just 1 event per year so the attendee part is not wanted and the table can be emptied prior to starting the next event the year after. The attendees do not have to match up, its just the answer values from question 11,12,13 & 14 to be put into rows and columns.

Thanks

~R


Guvnor

January 12, 2015 at 6:31 pm

Nevermind, got it working to display the fields.

Thanks


Dean

January 13, 2015 at 3:55 am

OK, glad you got it resolved. Anything else I can help you with?


Guvnor

January 15, 2015 at 4:32 pm

A last question on a shortcode [ANSWER_*] , Just wondering why its not displaying the answers. Are there only a few places that [ANSWER_*] can be placed? OR what is the correct formatting for [ANSWER_*] , I think I am missing something here.

Thanks ๐Ÿ™‚


Lorenzo Orlando Caum

  • Support Staff

January 15, 2015 at 5:01 pm

Hi Guvnor, the answers shortcode is case sensitive and requires an exact match to work as expected in various areas of the messages system.

For example, lets say you had a question like this:

Do you like kiwi?

The shortcode for the message editor would then be:

[ANSWER_*Do you like kiwi?]

Here is another example:

What is your favorite color?

The shortcode for the message editor would then be:

[ANSWER_*What is your favorite color?]


Lorenzo


Guvnor

January 15, 2015 at 6:21 pm

Hi Lorenzo,

Perfect answer!

So can that answer be used in conjunction with the attendee short code?

Thanks

Guv


Guvnor

January 15, 2015 at 6:26 pm

I would like to put it on a page that is not within an email template..just on a regular page etc


Dean

January 16, 2015 at 4:19 am

Not like that.

It can be done however it will require editing a template so PHP knowledge or access to a developer would be helpful.

In broad strokes what I would do is:

Copy this file (/wp-content/plugins/event-espresso/templates/attendee_list.php) over to wp-content/uploads/espresso/templates. This will stop your changes from being over written when the plugin is updated.

The I would use code found here: https://eventespresso.com/wiki/answers-shortcode/ and add it into the template within the foreach that outputs the attendees. The code needs to be modified to match the question/s you want to show.


Guvnor

January 16, 2015 at 5:24 am

/wp-content/plugins/event-espresso/templates/attendee_list.php

Such file doesn’t exist within the structure, just to reiterate,this is EE4, not 3

what I have on mine is /wp-content/plugins/event-espresso-core


Dean

January 16, 2015 at 6:25 am

Ahhh my apologies, I got slightly confused.

The answer that it won’t work in combination with the other shortcode is still correct though.

The only thing I could think of is taking a look at the additional_attendee_parser function in /wp-content/plugins/event-espresso-core-reg_448/caffeinated/EE_Caf_Messages.class.php and see if it could be used or at least examined for your needs.


Guvnor

January 16, 2015 at 7:00 am

So really, the short answer is that I can’t use [ANSWER_*] on any page outside of the expresso templates, for example a home page (unless I’m using my home page as a ticket registration page, event page etc), and that I can’t combine it without some major code hacking with any other shortcode.


Lorenzo Orlando Caum

  • Support Staff

January 16, 2015 at 11:48 am

Hi, the shortcodes that are part of the messages system can only be used within the messages editor.

These shortcodes can be used on WordPress pages and posts:

https://eventespresso.com/wiki/ee4-shortcodes-template-variables/


Lorenzo


Guvnor

January 16, 2015 at 12:09 pm

And they don’t do me any good for what I want to do anyways. Awesome!

Viewing 17 reply threads

The support post ‘Display Question Results On A Page’ 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