Support

Home Forums Event Espresso Premium Adding new column in List Template

Adding new column in List Template

Posted: December 3, 2014 at 3:15 pm


Deirdre Davenport

December 3, 2014 at 3:15 pm

I am in need of adding the Virtual URL as a column in the list custom list view template. I have been able to modify and get most of the other new columns I need, however do not know the name of the field for the virtual URL in the the event.

Here’s the code I was using:

<td class="event_title website-<?php echo $event->id;?>"><?php echo stripslashes($event->virtual_URL) ?></td>

But I am not getting any data on my page, which means I am most likely not using the correct field name.

Can someone help? Is there a published list of the core field names for the events?


Deirdre Davenport

December 3, 2014 at 3:16 pm

Here’ the link to the webpage where the event list is being displayed.


Deirdre Davenport

December 3, 2014 at 3:16 pm

http://juliegoodnight.com/web/schedule/


Deirdre Davenport

December 3, 2014 at 3:29 pm

through some additional hunting and pecking… I think I figured it out:

<td class=”venue_title venue-<?php echo $event->id;?>”><?php echo stripslashes($event->city) ?> <?php echo stripslashes($event->state) ?></td>

<td class=”event_title website-<?php echo $event->id;?>”>venue_url) ?>”>Visit Website</td>


Deirdre Davenport

December 3, 2014 at 3:30 pm

<td class="venue_title venue-<?php echo $event->id;?>"><?php echo stripslashes($event->city) ?>  <?php echo stripslashes($event->state) ?></td>'
			

<td class=”event_title website-<?php echo $event->id;?>”>venue_url) ?>”>Visit Website</td>’


Deirdre Davenport

December 3, 2014 at 3:31 pm

Trying to get the correct code in here but it is not working.

<td class="venue_title venue-<?php echo $event->id;?>"><?php echo stripslashes($event->city) ?>  <?php echo stripslashes($event->state) ?></td>
			<td class="event_title website-<?php echo $event->id;?>"><a href="<?php echo stripslashes($event->venue_url) ?>">Visit Website</a></td>	


Tony

  • Support Staff

December 4, 2014 at 3:25 am

Hi,

Looks like you have found the correct value.

Just to note for future reference, the virtual URL is in reference to the URL of the Venue, if you are using the Venue Manager (General Settings – ‘Use the Venue Manager’) there there is actually two places to store a URL for the venue.

One within the event itself – http://take.ms/5noIp

This (as you have correctly pointed out above) is saved within ‘venue_url’ and is usually pulled from the database with most events, so in this case as a simple example:

echo $event->venue_url;

However, the venue manager also allows you to save a website for the venue – http://take.ms/jSKnY

This value is also available although it is stored as a serialized array, usually within $event->venue_meta.

So to get that you would do something like:

$event->venue_meta = unserialize($event->venue_meta);

Then to output, something like:

echo $event->venue_meta['website'];

I know you had already found the value beforehand, just thought this may come in useful.


Deirdre Davenport

December 4, 2014 at 6:58 am

Actually this was helpful as I did have the Venue Manager turned on and that is why initially I could not find it.

For right now the client just wants a basic list. They will be using their online store to take registrations for now. They don’t want too many changes at the beginning.

Later I will need this info you provided as I am sure we will use the Venue Manager.

Thanks!

Last question… is there a list somewhere of all the internal fields?


Tony

  • Support Staff

December 4, 2014 at 11:44 am

Not currently.

The easiest way to find them is to use var_dump() on either the single object, or the array of objects pulled in.

So in this case you could do:

var_dump($events);

Which will output all the fields for each element in the $events array or simply:

var_dump($event);

within the foreach loop for $events. Both do the same with the exception that $events will show you all values for all the events you have (alot of it will be duplicated)

$event will shows output the values for each event multiple times. Whichever you prefer as they will both show all details.

The support post ‘Adding new column in List 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