Automattic / eventbrite-api

The Eventbrite API plugin brings the power of Eventbrite to WordPress, for both users and developers.
68 stars 40 forks source link

Removing ticket form widget from 'Eventbrite Events' template page (but not individual event pages) #67

Closed jacoblindgren closed 7 years ago

jacoblindgren commented 7 years ago

I'm interested to know if there are any recommendations for a method of removing the ticket form widget from the page that serves as an overview for all the events (the page with the Eventbrite Events template assigned to it) but have it remain for the individual event pages that WP generates (i.e. when you click on the name/photo of an event).

On a similar note, is there a way to change the height of the ticket form widget? At the moment it's not tall enough on my page and is scrolling. I've found what I think is the appropriate code on line 411 of inc/functions.php:

$ticket_html = sprintf( '<div class="eventbrite-widget"><iframe src="%1$s" height="%2$s" width="100%%" frameborder="0" vspace="0" hspace="0" marginheight="5" marginwidth="5" scrolling="auto" allowtransparency="true"></iframe></div>',

but I don't understand the significance of %2$s or what I could change it to (100% breaks it).

Thank you!

kwight commented 7 years ago

Hi Jacob,

I'm interested to know if there are any recommendations for a method of removing the ticket form widget from the page that serves as an overview for all the events (the page with the Eventbrite Events template assigned to it)

You could [remove it from your index template](I'm interested to know if there are any recommendations for a method of removing the ticket form widget from the page that serves as an overview for all the events (the page with the Eventbrite Events template assigned to it)) (it won't affect the single view template).

On a similar note, is there a way to change the height of the ticket form widget?

The best way to do this is with the eventbrite_ticket_form_widget_height filter, applied here.

jacoblindgren commented 7 years ago

Thanks very much for your reply.

Is the only way I can begin changing eventbrite_ticket_form_widget_heightthrough the pixel heights that are used? This works (by chance) for some events, but ends up being either too high or too short for other events, and always results in a scroll bar. Is there any way to display the ticket form widget in a height that it occupies, i.e. 100%?

Sorry if this is poor wording, I just can't manage to find a one solution fits all by using static pixel heights, and am wondering if there is a more responsive way to avoid the scroll bar on the ticket widget form. Thanks very much for your help.

kwight commented 7 years ago

I'm afraid not – being an iframe, Eventbrite has no idea what the height of its content might be – hence the complicated guess work. I'm sure there's a more elegant JS solution, but since there's no other JS at all in the plugin, we went with this "solution" for now.