Hey Luke: since we’ve been exchanging emails, is this still a concern? Let me know if so and I can get an answer for you.
Thread Starter
lukehm
(@lukehm)
Yes this is my major concern and is stopping me going live with events. You said you needed to talk to a dev.
I’ll try to explain further.
I have rather a complicated inline stylesheet that changes based on the template type loaded. This happens in the header and controls bgimages and various color styles.
I was expecting to be able to add a condition like if( is_post_type_archive(‘tribe_events’) ) to recognise the grid and list pages (/events/ and /events/upcoming/).
However this doesn’t recognise these pages.
What type of template are they using?
Do I need to use something like is_page_template() ?
It all works fine for the single pages, I use is_singular(‘tribe_events’) and is_singular(‘tribe_venue’).
Many Thanks L
Thread Starter
lukehm
(@lukehm)
Hi Rob
Further –
if (is_page_template(‘ecp-page-template.php’) ) nor if (is_page_template(‘events/ecp-page-template.php’) ) seem to recognise these pages.
Thanks
Thread Starter
lukehm
(@lukehm)
Final thought from me on this.
I realise that some of waht I need to achieve could be done using css and the body classes events-gridview events-archive events-list.
However for other elements I need a WordPress php conditional.
L
Thread Starter
lukehm
(@lukehm)
I’ll use this for the time being so I can get on with things
But hopeing you devs can come up with something more wordpress.
This is pretty ugly.
$arrBodyClass = get_body_class();
if (in_array(‘events-gridview’, $arrBodyClass)) {
$eventPage = ‘gridview’;
} elseif (in_array(‘events-list’, $arrBodyClass)) {
$eventPage = ‘list’;
} else {
$eventPage = ”;
}
L
Hey lukehm, currently the plugin employs a technique that does not function along the familiar lines of pages for the calendar/events list page. The reason we did it this was to make the plugin more plug-n-play with no page creation necessary. This has it’s drawback though as you can see and we’ve decided to revert back to a more standard system (not entirely sure what it’s going to be yet) but it will be totally compatible with standard page template tags to be able to conditionally display custom elements, sidebars, etc.
For now you’ll have to use the code you’ve got or use something basically as messy like:
if(tribe_is_month()) { //Calendar Grid
} else if(tribe_is_event() && !tribe_is_day() && !is_single()) { //Event List
} else { //Single Event
}
I hope that helps and look forward to the future!
Thread Starter
lukehm
(@lukehm)
Thanks Jonah
Very helpful
Glad that helps lukehm – let is know if there’s anything else we can help with this.
Thread Starter
lukehm
(@lukehm)
Thanks Jonah
I have posted something on the Pro forum about Ajax that I would like you help on.
L
Glad to see we got this issue resolved. Thanks, Jonah & Luke!