Are missing semicolons in templates causing my funky sidebars?

Home Forums Calendar Products Events Calendar PRO Are missing semicolons in templates causing my funky sidebars?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #969269
    Cynthia Lockley
    Participant

    In the calendar views, my sidebar is OK in most of them but gets messed up in others. Normally the sidebar should be one column. The messed up one is a split up column with part of the text in a one-word wide column with overlapping widgets and the other part of the text in a one-word wide column beside it. In 3.9.3, the sidebar is messed up in the Day View and the Photo View. In 3.10, it is messed up on Week View and Day View. The other views are all normal. Compare http://events.stcwdc.org/events/ with http://events.stcwdc.org/events/today/ (scroll down for the sidebars–they are below the calendar content because I can’t make the calendar content any narrower to fit with a sidebar).

    I tried to compare the view templates to see if I could find any differences in the ones that mess up the sidebar. What I found is some actions are missing the semicolon after the closing ) in front of the question mark (?). But that seems to be random in all the views. The view templates that work are missing semicolons in different places. The templates in the two versions are identical so that doesn’t explain why Map View in version 3.10 works but not in 3.9.3. Compare http://events.stcwdc.org/events/map/?tribe-bar-date=2015-06-13 (version 3.9.3) with my 3.10 test site http://competition.stcwdc.org/events/map/?tribe-bar-date=2015-06-13

    Are the missing semicolons the problem or is it something else affecting the sidebar? Thanks.

    #969332
    George
    Participant

    Hey Cynthia,

    The problem seems to be that your theme is applying custom CSS to events when the .error404 class name is applied to the body tag of your page. This will happen if you go to a date or day where there are not events – for example, contrast the day you linked to (which has no events, thus causing a 404 and that class name) with this day, which does have events and a correct-looking sidebar → http://events.stcwdc.org/events/2015-06-09/

    There are a few possible ways to get around this, including modifying your theme and such, but I think the simplest way would be to use a plugin one of our developers Barry made that prevents dates without events from registering as “404s” on your site. That should thus prevent the .error404 class from being applied to your page body tag, and therefore preserve the sidebar styles.

    To use this plugin, download it by going to this URL → http://m.tri.be/no404s

    That should download a .zip of the plugin for you, which you can then install as a plugin like normal on your site. Activate it after installing, and try going to that Day View you linked me to above.

    Let us know what you find! 🙂

    — George

    #969346
    Cynthia Lockley
    Participant

    Interesting. I had that 404 problem a few versions back for days that had no event and I was given a function to add to my functions.php file. It worked for stopping the 404s but now the problem with the sidebar started. I downloaded the no404s file and edited my functions file to delete the old function then activated the plugin. I did this for my prod. and test sites.
    In the test site (version 3.10) it fixed the Week View but not the Day View.
    http://competition.stcwdc.org/events/today/?tribe-bar-date=2015-06-14
    In the production site (version 3.9.3) there are now three views that have messed up sidebars: Week, Day, and Map views.
    http://events.stcwdc.org/events/week/?tribe-bar-date=2015-06-14
    http://events.stcwdc.org/events/today/?tribe-bar-date=2015-06-14
    http://events.stcwdc.org/events/map/?tribe-bar-date=2015-06-14

    #969566
    George
    Participant

    Hey Cynthia,

    Sorry that the plugin didn’t resolve this issue as thoroughly as I’d hoped. It seems, unfortunately, that your theme’s CSS is just getting in the way too much here and the only way out is to manually write some CSS to override the defaults.

    That shouldn’t be too much of a pain. For example, try adding the following CSS alone at the very bottom of your theme’s style.css file:

    
    .error404 #main .widget {
        clear: both;
        float: left;
        margin: 0 0 2.2em;
        width: 100% !important;
    }
    

    That will restore the default width, at least, and set a good groundwork for making further tweaks there if needed.

    One tricky thing is that the searchform is getting some extensive custom styling if the .error404 class is present on the page.

    You could manually try to overwrite each rule, but if it becomes a pain, you may find it easiest to just look for the block of CSS in that style.css file that looks like this:

    
    .error404 #main #searchform {
        ... (css would be here) ...
    }
    

    And delete that whole block of CSS.

    I hope this works decently for you – though not ideal solutions, the 404 issue doesn’t seem to be easily fixable at this point.

    Let us know if this helps!

    — George

    #969662
    Cynthia Lockley
    Participant

    Thank you. I would have never connected the Error 404 with the width of the search bar and the split sidebar in the Day view. I added your revision to the css for .error404 #main .widget to my child theme’s style.css. That helped the split sidebar problem. But why does the Day View have a different styling for the search bar than any of the other views?

    The other views do not show the sharing buttons at the bottom of the calendar and have a cleaner, narrower search bar. The Day View has a very different, wider, styled search bar and shows the sharing buttons. The view templates look the same at the end so I can’t figure out where the Day View is getting styled differently.

    I searched my entire folder for .error404 #main .widget and discovered that styling for Error404 is in my theme’s style sheet and in the Jetpack style sheet. The only difference between the two is the font size in .error404 .widgettitle. In the Jetpack style sheet, the font-size is 0.769em. In the theme’s style sheet, the font size is 10px.

    #969784
    George
    Participant

    Hey Cynthia,

    Thanks for your patience with this issue. I’m not 100% certain why the Day view shows things differently (although, for me personally, it doesn’t seem to be different on the day view than it is on the other views – the only difference is the presence of text that reads “Search this site” about the search bar).

    At this point, I could only surmise that your theme is again the culprit for that issue – I don’t notice any Body class names that are immediately or problematically different, so I’m not sure here, but that would be the best place to start.

    Aside form all of this, I’m curious – what do you have for your “Events Template” setting if you head to Events > Settings > Display in your admin? Here’s a screenshot for reference → https://cloudup.com/cY7w9vAC8wB

    I’d recommend trying out all the available options to you there, which depends on your theme. Try each one, save the changes, and then give your views another look. It’s possible that changing this template might help in some way.

    I appreciate your patience with this issue greatly, and am sorry that there seems to be some core issues with your theme that are hard to workaround.

    #975504
    Cynthia Lockley
    Participant

    Hello,

    I’ve been out of town for a few weeks but I’m back again. After trying everything above, the sidebar still messes up in Day, Week, Map, Photo, and List views if there is no event for that Day, Week, Map, Photo, or List. When there is no event, the page title of the page shows 404 Not Found even though the page is there and this gets recorded in Google Analytics as a 404 missing page. There seems to be no way to stop the 404s even though I installed the 404 fix plugin and have a function from a few years ago in functions.php that does a similar thing. (I tried deleting the function after installing the plugin but there is no difference with or without it–still generates lots of 404s.

    I cannot figure out why two of the views that don’t work are picking up a different formatting for the search bar widget and include the sharing buttons when none of the other views do that. (If there is an event there in a view that messes up when there is no event, the search bar widget formatting is normal and the sharing buttons are not included.)

    Since there seems to be no way to fix getting 404s when there is no event, I have changed the allowed views to just a Month view in the Display settings. That is the only view that works.

    #976281
    George
    Participant

    Hey Cynthia,

    Did you try the “Events Template” settings changes I recommended, or running through the Testing for Conflicts steps outlined here? → https://theeventscalendar.com/knowledgebase/testing-for-conflicts/

    Both tests might be useful here – thank you for the udpate and for your patience with this so far. Let us know if you can run through the two tests I recommended above, and if so, what you find.

    Thank you!
    George

    #976542
    Cynthia Lockley
    Participant

    I looked at your screen capture of your display setup. I am using the default page template. There is no front page template in my list. See my screen captures at

    http://www.stcwdc.org/images/display-template-setup.png

    http://www.stcwdc.org/images/default-page-template.png

    I am using a Twentyeleven child theme. All the plugins are up-to-date. I did not have the Twentythirteen theme installed so I installed it and switched to that one. Doing that trashed all my text widgets in the sidebar–they did not get put in the inactive widgets section–they just disappeared. That did not fix the problem. I turned off all the plugins except the Events Calendar ones. That did not fix the problem. I reverted back to my original theme and had to recreate all my text widgets to restore them. Then I turned on plugins one by one. That did not fix the problem.

    Looking back at some of my previous problem posts to the forum, I see that I had this same problem in Nov 2014 after the 3.8 release. See the top of https://theeventscalendar.com/support/forums/topic/upcoming-events-there-are-no-upcoming-events-at-this-time/. That problem was fixed when I was told to delete the widget I was using named Upcoming Events and replace it with a new widget named Events List. It did the same thing but had a different name and had a title area, in which I put “Upcoming Events”.

    I am wondering if something similar has happened in this latest release that was unannounced as a change? Has the widget that we use to list upcoming events in the sidebar been changed again or is there a new widget we need to replace the Events List widget with?

    I looked into the Theme Override suggestion: Do you have any theme overrides? Try disabling them by renaming your [themename]/tribe-events/ folder to ‘tribe-events-bak’. I did that and the widget worked. Now to try to figure out what is in there that is causing this. Because of all the problems with installing a different theme and having it destroy all the sidebar text widgets I had and having to rebuild the sidebar, I suggest you put this Theme Override test at the top as the first thing to try.

    #984459
    Cynthia Lockley
    Participant

    George,

    I had a template override in my tribe-events folder in my child theme in /tribe-events/widgets/. It is very different from the one in the current version. I was sent it by someone in Support as a replacement to fix a problem, which I guess is no longer a problem. I deleted it and now the Upcoming Events widget is working.

    I still have the List, Day, Week, Map, and Photo views turned off because of the 404 Not Found problem when there is no event. While looking in the tribe-events folder, I looked at the override template for month/single-day.php. That is another replacement file I was sent by Support to get around the 404 Not Found problem in month view if there were some no-event days in the month in version 3.8 (I think) with some additional functions related to it in my child functions.php. It did fix the problem for month view. A permanent fix was supposed to be worked into the next release but it wasn’t (several others were complaining about the same problem.). Those fixes and the no-event-404s plugin are not fixing the 404 problems for the other views. The code is the same for converting 404s to 200 but they differ above that. I copied the function given to me for the month view and made ones for each of the other views in my child functions.php file but that didn’t help them. Perhaps each of the views need similar modifications as was done for the month view but I’m not a PHP programmer so I can’t tell what that would be. I compared the override file with the 3.10 version of the single-event.php file and it is quite different. Since I’m not getting 404s for month views with empty dates, that override file and related functions seems to be working. Without it, month view generated a huge number of 404 errors and I don’t want to go back to that again. Does this give you any clues as to why the other views are now giving us 404 errors for empty dates?

    #984822
    George
    Participant

    Hey Cynthia,

    I’ve said it already but I just want to say it one more time: thank you for your continued patience with these issues.

    I’m glad that the widget-related ones are resolved now.

    As for your other issues, I’m trying to boil down what you wrote to its essence and it seems like the only remaining problem is that your widgets get squished on 404 pages. Is this accurate?

    I say that because our templates are indeed different now than before. I do not know what version of the plugins you were running when you sought support and were recommended various template files. They’re likely outdated by now and causing more problems than they solve.

    And I summarized your issues as the widgets being squished on 404 pages because, while you described getting 404s on empty dates, this is the default functionality of the plugin. And even with the no-404s plugin, it sounds like your sidebar are still getting squished in some views?

    If this is not your current problem, can you summarize what they are?

    Thank you!

    PS
    You mention that Google Analytics is listing these no-event pages as 404s, and while this is frustrating to see in your Analytics dashboards, I just want to point out that no actual harm is being done by this and you will not be penalized by Google for having those links be 404s.

    #989325
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Are missing semicolons in templates causing my funky sidebars?’ is closed to new replies.