ecp-page-template modifications

Home Forums Calendar Products Events Calendar PRO ecp-page-template modifications

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #19407
    Jim McClain
    Participant

    The theme I am using, Weaver II Pro, on http://featherrivercountry.com/events/ uses 2 sidebars, one left of content, the other right of content. The right sidebar only has Upcoming Events. I don’t need that sidebar on the calendar grid or event list page, but because The Events Calendar does not use short code to place the calendar on a WP page, I can’t turn a sidebar off. I’ve tried other template selections and, of course, none have the desired effect.

    Can the ecp-page-template.php file be modified and saved to the /themes/events folder? More specifically, can it be modified so that the left sidebar only is hard-coded in, allowing the calendar grid and list page to fill the rest of the right side of the page? I thought, by using some of the code from the theme’s own page.php, it would make the styling of the page much easier. Here is a link to the source of page.php for Weaver II Pro: http://pastie.org/3934370

    I don’t know how to code in PHP or what HTML code might be necessary to create this modified page, so I hope someone out there in Modern Tribe could help. Short of wishing for the return of short code to create an actual WP page, I think this may be the only option.

    Thanks for any guidance,

    Jim McClain

    #19447
    Jonah
    Participant

    Hi Jim,

    The ecp-page-template.php file can be modified and if you do modify put it in an ‘events’ folder inside your theme.

    Have you tried changing the Events Template setting in Settings > The Events Calendar > Template? There you can force the plugin to use your themes page.php template instead of ecp-page-template.php

    Maybe that will help? You’re likely going to need to use some conditional logic to determine the sidebar situation on different events pages. I’ve put together some conditional wrappers covering the primary event related pages so this should help you: https://gist.github.com/2415009

    Cheers,
    Jonah

    #19479
    Jim McClain
    Participant

    Let me ask you this: Which would be easier and less problematic over the long haul, using the conditionals in page.php (added to my child theme), in ecp-page-template (added to the “events” folder inside my child theme), or creating a new page template with the desired sidebars hard coded in? I’ll defer to your guidance and then we can go from there.

    Keep in mind that the way I have Weaver II pages and posts configured, is with a center content column and left and right sidebars. Individual pages can be configured to remove one or the other, or both, but posts can’t (I don’t have any problem with the 3-column setup on any of The Events Calendar “pages” except the grid and list that appear on a “virtual page”).

    Thanks,

    Jim

    #19481
    Jonah
    Participant

    Hey Jim,

    I would probably go with a custom page template based off of the page.php template simply because it will contain similar code to your theme and it won’t interfere with your page.php template keeping things more organized.

    Good luck!

    – Jonah

    #19515
    Jim McClain
    Participant

    Yeah but… I do agree, it has all the theme related code, so would prob’ly be the best jumping off spot. But now the big question… how do I create a new page template that already has the sidebars I want? Most page templates still use the options set up for the particular theme sidebar setup. In this case, that’s 2 sidebars, one on each side of the content. I need to make sure the right sidebar does not get put in there and the center content column expands to fill that space.

    Any ideas or guidance?

    Jim
    PS: has anyone reported that the email notification doesn’t work?

    #19531
    Rob
    Member

    Hey Jim. I’ll let Jonah respond as to the new templates (as he’s better equipped to do so than I), but as for the notifications…we have been getting increasing reports of this lately and we were just able to verify it on our end as well. I’ve bumped up the priority and have a dev looking at it today or tomorrow…hopefully we can get the issue finalized/squared away this week. I apologize on behalf of the whole team for any inconvenience in the interim, though.

    #19536
    Jim McClain
    Participant

    Thanks Rob. I guess there’s no member control panel, of sorts, so a member can see a list of topics subscribed to when first logging on. Kind of a strange forum. I’ve discovered a couple of weird ones lately and I’ve been using/managing forums since 1992. I’ll get used to it.

    Anyway… an update:

    I was able to get my calendar on a custom template page that is just a modified version of the Weaver II Pro page.php. Here’s the source: http://pastie.org/3950970 My only edits were to add a style declaration to the container_wrap that makes that div 83% wide (sidebars are 17%). Then I commented out the call for the right sidebar. Of course, to create a new page template, that information must be at the top of the new file.

    I like that my calendar grid is now wide enough to be easier to read. What I didn’t realize is that all the calendar pages now have only 2 columns, instead of 3 on all pages except the grid and list views. Somehow I was under the assumption that the page template was used on specific areas of the calendar and other pages used the standard WP post layout.

    I think the conditionals would help this situation a lot. Unfortunately, my only experience with conditionals is in forum software (like vBulletin), where instructions for their use is well documented, including examples.

    Can I ask for some instructions or a few examples to get me started including them in the new page template? Would it be better if I started a new topic about this so it would be easier for others to find?

    Thanks,

    Jim

    #19560
    Rob
    Member

    Jim: thanks for the follow-up. I think this topic is a fine location for it (no need to create a new one), but I’m admittedly not the person best equipped to answer this. Jonah is in a better position to do so and I’ve asked him to directly. Stay tuned on that end and thanks for your patience / support thus far.

    #19572
    Jonah
    Participant

    Hi Jim, no need to create another topic. You’re right and we know that our documentation needs some work. We’ve just got limited resources right now and can’t do everything.

    Using the conditional should be pretty easy if you were able to create the new template and comment out the sidebar. All you’ll need to do is use the conditionals like this:

    if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
    get_sidebar('the-name-of-your-sidebar');
    } elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
    get_sidebar('another-sidebar');
    } elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
    get_sidebar('the-name-of-your-sidebar');
    } elseif( tribe_is_event() && is_single() ) { // Single Events
    get_sidebar('single-events-sidebar');
    } elseif( tribe_is_day() ) { // Single Event Days
    get_sidebar('another-sidebar');
    } elseif( tribe_is_venue() ) { // Single Venues
    get_sidebar('another-sidebar');
    } else {
    //no sidebar
    }

    In this example I’m showing how you can actually call different sidebars with get_sidebar and by wrapping each call in a conditional you will only use that sidebar when the condition is met.

    Does that help?

    #19580
    Jim McClain
    Participant

    Yes, Jonah, that does help. I saved those conditionals last week when I was searching the forum for help. Problem for me is, I don’t really know where to insert the conditionals in my new page template.

    When I commented out the right column call in the page template, the sidebar didn’t show, but the center column remained narrow, as if the right sidebar was there. When I used inline style to increase the width to 83%, it looked much better (still not sure it’s exactly right though). Is there any conditionals that would work for that?

    As you can see from the link to my page source code, the sidebar I DON’T want is called near the bottom, from the same PHP the footer is in. The wrapper div for the content column is right after the call for the left sidebar, near the top of the source. The left sidebar I want on all pages, so I’m guessing I don’t need any conditionals for that one.

    I sure hope this isn’t out of bounds for your support. I do appreciate the lengths you go to help your customers.

    Jim

    #19612
    Jonah
    Participant

    Hi Jim,

    Try this: https://gist.github.com/b9aa15e5e4122ed8b6fc

    Basically all I did was wrap the right sidebar call in the conditionals so on specifici event pages the sidebar will still display. Does that work?

    Cheers,
    – Jonah

    #19614
    Jim McClain
    Participant

    Thanks Jonah, that’s more than I expected. I am getting ready for a 80 mile trip to Reno (doctor’s appointments, not gambling), so I won’t be able to try this out until tonight. I have a feeling the right sidebars are gonna have trouble with that added width I put in to the center column. I’m guessing I can add these same conditionals to that HTML in the file (‘n fact, I’m almost positive – even better, I believe I can put just one set of conditionals in and have them apply to that whole block of code). I’m gonna be giddy as a ten-year old when I see this work – or maybe that will just be the drugs. 😉

    You guys do know you have set the bar awfully high for all them other plugin masters.

    Jim

    #19621
    Jonah
    Participant

    No problem Jim, try it out when you can and let me know how it works for you. Maybe the drugs will help 😉

    #19671
    Jim McClain
    Participant

    I tried my edits to the page template. Here is the source: http://pastie.org/3959529

    Parse error: syntax error, unexpected ‘<' in /my/server/path/domainfolder/wp-content/themes/weaver-ii-pro-child/custom-events-layout.php on line 31

    I thought I was supposed to enclose the conditionals and the source code they applied to in a, opening and closing PHP tag. After that error, I tried removing the PHP tags. You can guess what the page looked like when I did that.

    So, not having studied much PHP, I'm kinda at a loss here. I knew I had to do something, because the source code you created would have broken the layout had I left that style declaration increasing the width of the content wrapper to 83%.

    When I remove all of my code, including the styled width, the page template works just fine, except for on the pages the right column has been removed. On those pages, the width of the calendar grid remains narrow, as if the right sidebar were still there.

    I'm hoping that parse error is just a minor problem and this is easy to fix.

    Jim

    #19674
    Jim McClain
    Participant

    Well, I did some more research and played around with it some more. Thanks to your guidance and a couple of tutorials on combining conditionals, I got it to work. No errors in the PHP.

    Here’s the code I used for the variations in the content wrapper width:


    <div id="container_wrap" style=”width:83%;”>

    <div id="container_wrap">

    And here is the modified conditionals for the right sidebar:


    I like the way that works. Now I have a better understanding of the WP conditionals. I also discovered that reading the comments on a tutorial can be very helpful. One posted several examples of combining conditionals and I couldn’t figure out what I did wrong. Turns out, it wasn’t me that did it wrong, it was the tutorial author. Someone deep into the comments corrected him and the author never fixed the problem.

    Even so, I hope you’ll let me know if that code I used is okay. I know how bad PHP code that seems to work can cause nasty problems down the line. Thanks again for all your help.

    Jim
    PS: to anyone wanting to do a copy & paste, I’m not sure if the vertical bar is rendered properly in a forum post. It’s a weird character that sometimes gets twisted up with a broken bar symbol (¦) somehow. I have included the whole source page for my custom template page at pastie.org: http://pastie.org/3960116 I don’t know how long those pages last. If it’s gone by the time you read this, contact me at featherrivercountry.com and I’ll be happy to share.

Viewing 15 posts - 1 through 15 (of 21 total)
  • The topic ‘ecp-page-template modifications’ is closed to new replies.