Content loads and then disappears. Help!

Permalink
I'm dealing with a major issue. When trying to load a page, it loads it for a split second, and then it all vanishes (all except for the admin bar).

Strange thing is, it comes back when in edit mode and everything looks fine. But as soon as I exit the edit mode, it all disappears again. I'll include a video to show the effect:

https://www.youtube.com/watch?v=ahbU9Psuve4&feature=youtu.be...

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi ghoststalker194,

Are you using a custom theme?

If you are, do you have the same problem if you switch to the default Elemental theme?
ghoststalker194 replied on at Permalink Reply
Hey, I just tried it. Elemental seems to work all right.
It is indeed a custom theme, one I made myself. It used to work fine, but I suddenly had to take a few weeks off for school work and only just came back.

Had to login again and suddenly.... well.... this. Because it happeneds 'after' it's loaded, it made me think it might be a jquery issue (seeing as it's loaded last) but I've removed my .js file and it still does it.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@ghoststalker194

Do you have any errors in your browser console?

Are you registering your assets in your page_theme.php?
ghoststalker194 replied on at Permalink Reply
Not getting any error messages.It is as if there's a global .hide code somewhere that simply hides all.

That said, when I inspect my code, everything 'is' still there and in the proper place. It's just invisible.

I'm not sure what you mean with registering. Sorry I'm new to concrete and I'm still figuring things out. =)
MrKDilkington replied on at Permalink Reply
MrKDilkington
@ghoststalker194

If you zip up your theme and attach it as a reply, I can take a look at it.
ghoststalker194 replied on at Permalink Reply 1 Attachment
Here you go. I think I've narrowed the problem down, which has made things even more confusing.

I'm pretty sure it as to do with the .css file. When I remove it, stuff no longer disappears. I've done some more digging and it appears as if everything that has a Float in it seems to vanish after the page is loaded.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@ghoststalker194

Zip the file instead.
ghoststalker194 replied on at Permalink Reply
Done, sorry! See my previous post for the .zip file.

EDIT:
It could also have something to do with the:

<?=Loader::element('header_required'); ?>

or the
<?=Loader::element('footer_required'); ?>


When I remove these bits of code, the content doesn't disappear either.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@ghoststalker194

The issue was caused by float being applied to the majority of your theme elements.

The header_required and footer_required, are required to use concrete5.

In the root of your theme, you are missing default.php and have PHP files containing code snippets. I believe concrete5 is looking for page templates in the root, causing these code snippets to be read as page templates. These code snippets should be put into a folder (often called "elements" or "includes") and included.

default.php
"This template is used any time a page that has a specific page template can't find a file in the theme's directory that matches the template's handle."

It appears that each page template is a full page. A better way to manage page templates is to find the code that they share and make an include for it.

This documentation covers reusing theme code:
http://documentation.concrete5.org/developers/designing-for-concret...

I recommend reading this section of the documentation on theme building:
http://documentation.concrete5.org/developers/designing-for-concret...

I also recommending using a grid framework to handle the layout and to make your site responsive. A popular and easy to use grid framework is Bootstrap.
http://getbootstrap.com/css/#grid...
ghoststalker194 replied on at Permalink Reply
Thanks for the feedback. I'll give it a try tomorrow!
MrKDilkington replied on at Permalink Reply 1 Attachment
MrKDilkington
@ghoststalker194

I have attached the two files I changed to keep the page content from disappearing.