I'm wondering if there a simpler way to achieve this, that cuts down on the number of queries submitted to the server:
I have a section on the home page where users can purchase tickets to an event. I don't have ticketed events that often, so I only want that section to display when tickets are available.
The way I've been doing it is like this:
{exp:channel:entries channel="ticketed_events" limit=1}
<h2>Purchase Tickets</h2>
{/exp:channel:entries}
{exp:channel:entries channel="ticketed_events"}
{event_title} - {ticket_price}
{/exp:channel:entries}
I have to do it twice so that the title only displays the one time, instead of once per entry. That seems a little awkward, having to send two queries to the server like that. Is that really the only way to do it?
ty
{exp:channel:entries channel="ticketed_events"}
{if count == 1}<h2>Purchase Tickets</h2>{/if}
{event_title} - {ticket_price}
{/exp:channel:entries}
Without trying that should do it, otherwise try {if {count} == 1}