Support

Home Forums Event Espresso Premium Attendees answer in listing displays 2 times.

Attendees answer in listing displays 2 times.

Posted: May 22, 2014 at 5:45 am

Viewing 4 reply threads


Pim Stumpel

May 22, 2014 at 5:45 am

Hi there,

I was wondering if you could help me out with a little problem.
I use the ATTENDEES LISTINGS shortcode, to show a list of the entries of my event.
Now i wanted to add the the city name to the listing, and i used to do that with: the EE answer shortcode in the attendee_list.php.

So i added: $custom_question_1 = ‘<span class=”attendee-answer”>’. do_shortcode(‘[EE_ANSWER q=”6″ a=”‘.$id.'”]’) . ‘</span>’;

to the file, and it works because with css i determined that it should float to the right, like this:

.attendee-answer {
color: #000;
float: right;
display: inline-block;}

Buttt now i see, that the list was already echo’ing the city under the Name by itself. So now i have the city two times in the list.

I want to have the city on the right side, as is, and the one under the name gone.

could you help me to do this?

This is a link to the page where it goes wrong:
http://www.dinghycoach.nl/entries-29er/

hope you can help me out so i can fix it again:)

cheers


Tony

  • Support Staff

May 22, 2014 at 5:59 am

Hi,

The question your are pulling using [EE_ANSWER q=”6″ a=”‘.$id.'”] appears to be the system question ‘city’, is that correct?

If so you do no need to pull the info again as you are now. You can simply add you span with the custom class around the $city_state variable on line 91.

<li class="attendee_details"> <span class="espresso_attendee"><?php echo $gravatar ?><?php echo stripslashes_deep($fname . ' ' . $lname) . '<span class="attendee-answer">' . $city_state . '</span>' . '</p>'; ?> </span>

$city_state actually outputs the attendees City and State, so you coud just change that to $city to just display the attendees city.

So then you wont need the $custom_question variable to pull and info, or be included within the output.

Does that make sense?

Also have you moved you modified attendee_list.php template file to wp-content/uploads/espresso/templates/ to prevents it being overwritten during updates?


Tony

  • Support Staff

May 22, 2014 at 6:02 am

Just to note, the syntax highlighter modified the code as I posted it, it has now been corrected.


Pim Stumpel

May 25, 2014 at 3:17 am

Hi there,

thank you for your response, it sounds clear.
I removed the EEanswer code again, so now it is displayed once.
But i kind of changed my mind and prefer to display only the name.
Which code should i fill in to display the name and not the city?

In other events i do use a EEanswer shortcode to display a sail number, and that needs to keep working.

So only the city needs not to be displayed for now.

hope you can help me out again:)

to answer your other question, yes i kopied the file to the uploads…etc. folder, so changes won’t be lost:)

cheerss


Sidney Harrell

May 26, 2014 at 2:29 pm

Then you would change line 91 to be:

<li class="attendee_details"> <span class="espresso_attendee"><?php echo $gravatar ?><?php echo stripslashes_deep($fname . ' ' . $lname) . '</p>'; ?> </span>


Pim Stumpel

May 27, 2014 at 4:38 am

Hi again,

is it possible to add some kind of css code that refers to the city id?
Because we have a lot of events, and if i can add a css code maybe something like:
display: none that only refers to the city, i can when needed get the old code back just by deleting the css code.

Because if i change the code in the php file, and want to go back to the file i use right now, i have to search what to add again.

i’m sorry if my explanation isn’t clear, i did my best ha ha.

hope you have any other suggestions?

cheers


Dean

May 27, 2014 at 6:51 am

Hi,

You could change the template to something like this

<li class="attendee_details"> <span class="espresso_attendee"><?php echo $gravatar ?><?php echo stripslashes_deep($fname . ' ' . $lname) . '<span class="citycss">' . $city_state .'</span>
'; ?> </span>
<div class="clear"></div>
</li>

which adds a span around the city with a class citycss, which can then be targeted by CSS.

With a little bit of HTML and PHP you could modify that whole template to suit your needs. If you don’t know HTML or PHP you may wish to contact a web developer to assist you.

  • This reply was modified 10 years, 6 months ago by Dean. Reason: forgot to syntax highlight the code
Viewing 4 reply threads

The support post ‘Attendees answer in listing displays 2 times.’ 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