Community Forums › Forums › Archived Forums › General Discussion › Tribe EVents Calendar, Conditionals, and lack of page.php
Tagged: full width, page.php, the events calendar
- This topic has 18 replies, 3 voices, and was last updated 11 years, 7 months ago by
Summer.
-
AuthorPosts
-
September 25, 2013 at 5:24 pm #64189
suzyo
MemberHi all. I'm using the ModernTribe Events Calendar (TEC), including the Community Submissions Form. TEC uses the default theme's layout settings.
Here's my problem: I need to either #1 apply conditionals to get rid of the sidebars, or #2 force full-width on the Community Submission Form. There's no other way to do it.
The url to the form is below.
TEC support says to apply conditionals to page.php, specifically,
"The Community Events plugin uses your theme’s page.php template so you’ll want to edit that and use the following conditional code to detect when you are on one of the community pages and show/hide whatever sidebar you want that way.":
'if(tribe_is_community_edit_event_page()) {
echo 'this is the submit/edit events page!';'
}
but this is Genesis. I don't gotz no page.php. What to do? Where is my beloved Brad Alton? Note: I am open to new beloved(s).
http://sandboxing.capemyers.com/events/community/addSeptember 25, 2013 at 5:39 pm #64192Summer
MemberIf you edit those pages, do you see the "Layout Settings" meta box? You could just select the full width layout there... you may or may not have to adjust your screen options to see it.
If you don't have that in there, do the calendar and submission form use specific page templates? That's where you'd add the conditional, otherwise.
If not, you could make a page template, switch those pages to that template, and the only thing in that template you'd have would be the call to force a full width layout. I've had to do that myself on occassion 🙂
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkSeptember 25, 2013 at 5:43 pm #64194suzyo
MemberHI Summer, and thanks. The problem is that a template cannot be applied to the TEC stuff, it's not on a "page". It uses the page of the theme it is applied to.
See what I'm sayin'?
September 25, 2013 at 5:48 pm #64196Summer
MemberNot exactly...
are you using shortcodes to put the calendar in a specific page or post? If so, that is the page or post you'd select the different layout for. That's what I had to do when I added a Time.Ly events calendar to a couple of my sites.
If that's not how you're using it, could you explain a little more how you're putting the calendar on your site?
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkSeptember 25, 2013 at 5:58 pm #64197Tony @ AlphaBlossom
MemberHi, I'm not familiar with the Community Submissions Form, never used it, but maybe this will help get you going:
add_filter('genesis_pre_get_option_site_layout', 'abte_full_width_layouts'); function abte_full_width_layouts($layout) { if ( 'tribe_events' == get_post_type() ) { $layout = 'full-width-content'; } return $layout; }
That would go in your functions.php (child theme) file.
All Tribe Events Calendar pages will be full width. I couldn't tell if you're ok with that, or only the Community Submission Form.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
September 25, 2013 at 6:04 pm #64200suzyo
MemberHi Tony, hi Summer, thank you.
Tony, I want the Community Events submission form to be the only full-width "page".
Summer, the Community Events submission form is not a page, rather, it displays by dynamic, on-the-fly creation of a "page" based on your theme's page.php. No shortcodes, because, no place to put 'em. Conditionals only, to be written on the underlying page, which is your theme's page.php, which does not exist in Genesis.
The Events Calendar itself uses a number of templates, but there IS NO TEMPLATE for the submission form.
Yeah, weird, I know. As I wrote above, the dev says:
"The Community Events plugin uses your theme’s page.php template so you’ll want to edit that and use the following conditional code to detect when you are on one of the community pages and show/hide whatever sidebar you want that way."
I can't apply the conditional(s) to a template that doesn't exist. (Actually I tried to add it to page.php in the Genesis Framework itself, but, no go.)
It's hump day.
September 25, 2013 at 6:22 pm #64204Tony @ AlphaBlossom
MemberMaybe this will help you:
https://tri.be/support/forums/topic/conditionals-to-change-page-on-submission-form/
It lists two conditionals:
tribe_is_community_edit_event_page()
tribe_is_community_my_events_page()also says the new version (a couple days away) will use the same template as the calendar.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
September 25, 2013 at 6:26 pm #64206suzyo
MemberTony, you linked me to my own post, and, if you look carefully, you'll see that they did not answer my question.
My question is how to apply the conditionals when there is no page.php in Genesis.
September 25, 2013 at 6:33 pm #64208Tony @ AlphaBlossom
Memberhehe that's funny...sorry.
How about this:
if ( tribe_is_community_edit_event_page() || tribe_is_community_my_events_page() ) {
If that doesn't work, i'll have to leave it for someone else to try.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
September 25, 2013 at 6:35 pm #64209suzyo
MemberTONY! Have you read any of the posts? I KNOW HOW TO USE THE CONDITIONALS. THE PROBLEM IS THAT THERE IS NO PLACE TO PUT THEM BECAUSE GENESIS DOES NOT HAVE A PAGE.PHP
September 25, 2013 at 6:36 pm #64210suzyo
MemberAnd, thank you, but I'm frustrated. Nobody has understood the question.
September 25, 2013 at 6:36 pm #64211Tony @ AlphaBlossom
MemberTake it easy, no need to yell. Just trying to help. Have a great night...
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
September 25, 2013 at 6:53 pm #64217Tony @ AlphaBlossom
MemberTony, you linked me to my own post, and, if you look carefully, you’ll see that they did not answer my question. My question is how to apply the conditionals when there is no page.php in Genesis.
BTW, this is marked as private, so as carefully as I looked I could not read this nor their reply (also private). Just fyi.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
September 25, 2013 at 6:56 pm #64219suzyo
MemberThis reply has been marked as private.September 25, 2013 at 7:09 pm #64222Summer
MemberYou wouldn't add that conditional to the page.php in the framework, because you'd lose it next time you updated Genesis.
Did you try creating a page.php in your child theme, and put the conditionals to make the submission form full width there?
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkSeptember 25, 2013 at 7:11 pm #64223suzyo
MemberNo, because the calendar would not be using this new page.php, because it doesn't exist. As I keep saying, TEC Community Events submission form is not written on a page, nor does it make use of a page. It is created dynamically, on-the-fly, and uses the underlying page.php.
HOWEVER, I don't HAVE a page.php, so it is using something ELSE.
To create a page.php would be like yelling to Mars while the people on Jupiter are waiting for your message.
September 25, 2013 at 7:54 pm #64228Summer
MemberYou said the Tribe people told you to modify the theme's page.php, therefore it is using page.php.
Since there isn't one in the child theme, it defaults to using the one in the framework, but if you create one in the child theme, that one will supercede the one from the framework. That's the beauty of child themes.
So if you make a page.php in the child theme and customize it, it will do the work that the default framework one is currently doing.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkSeptember 25, 2013 at 8:32 pm #64234suzyo
MemberThanks, Sommer. I did that earlier. This is the framework's page.php
'<?php
/**
* Genesis Framework.
*
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Genesis\Templates
* @author StudioPress
* @license GPL-2.0+
* @link http://my.studiopress.com/themes/genesis/
*///* This file handles pages, but only exists for the sake of child theme forward compatibility.
genesis(); 'September 25, 2013 at 10:22 pm #64239Summer
MemberYup, so make a copy of that in your child theme folder, then add the conditionals you need, and any other custom calls you want before the "genesis()" call, and you should be good to go.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After Dark -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.