Subpages are empty

Hi there,

at first, I want to apologize for my bad english. I’m just no native speaker.

I just gave kirby a try and ported the website of our vintage car club from typo3 (not my choice) to kirby. Since I’m a computer scientist, I realy like the way kirby supports the website developer instead of hiding all the fun stuff behind a fat backend with buttons and funky icons everywhere. Good work!

So I started by installing XAMPP on a local Windows7 machine and putting the latest kirby in there. Then I added templates, content, etc. After just a few hours, everything was done and the website worked as expected, without any issues. So I loaded up the whole stuff to the public webserver. We rent a managed webspace at Strato (germany). On there support page they claim that they provide mod_rewrite and you can choose between PHP5.3, 5.5, 5.6. Anyway, I putted die whole stuff which was working perfeytly fine under windows in a subfolder of the webspace and adapted the RewriteBase in the .htaccess accordingly. Then I tried to call the website with the webbrowser. The panel worked out of the box. I can login and go through all the pages there - no problems. Just the site previews of the most sites (but not all) don’t display anything. So I called the website directly in the browser and the start page was absolutly fine. It works if I call myDomain/kirbysubfolder and myDomain/kirbysubfolder/home, where home is the name of the start page. But when I go on any other subpage via the websites menu, I got just a blank website with no error message at all. When I look at the source code of this blank page, there is not even a single symbol in there. I checked the generated links on the menu and they look fine to me, they are like: myDomain/kirbysubfolder/subpage. I tried it with all available PHP versions. With 5.3, kirby does not work at all, which wasn’t a supprise after reading the manual. But with the other two versions I have this problem.

Here is a code snipped how I create the links in the websites menu:

<div id="navigation">
    <ul class="navi">
    <?php foreach($pages->visible() as $p): ?>
    <li>
      <a <?php e($p->isOpen(), ' class="active"') ?> href="<?php echo $p->url() ?>" onfocus="blurLink(this);"><?php echo $p->navtitle()->html() ?></a>
    </li>
    <?php endforeach ?>
  </ul>
</div> 

I’m realy out of ideas what the problem could be. Keep in mind, that everything works fine on the local installation and the panel works well on the public server as well. So my best guess is an issue with mod_rewrite, but would the panel work properly in this case?

I’m greatfull for every hind.

Cheers, Felix

Have you tried first without setting the rewrite base? With or without the RewriteBase setting, you could also try to set the url in your config.php.

The panel requires mod_rewrite and it seems to be working, but it’s a bit strange that not all preview links work.

If the pages are completely blank, it could also be a server-side HTTP 500 error. Could you please check if there’s something in your error_log?

Yes, I tried with and without setting the rewrite base. I even puted kirby in the root folder of the webspace and commented the rewrite base. I tested a rewrite base with a single / as well - always with the same result.

How can I set the url in the config.php? I can’t find this in the documentation.

Cheers, Felix

I would love to have a look in a log file, but it’s just a managed web space. I honestly have no clou how to get my hands on a log file. :confused:

Cheers, Felix

Usually, there should be a folder called logs in the root of your webspace, even in shared hosting,sometimes it’s probably not enabled, though, and you would have to do that in your settings. If necessary, contact your hosting provider.

Did you turn debugging on in your config.php?

c::set('debug', true);

For the url option, go with this one:

c::set('url', 'http://your-domain.com/your-subfolder');

http://getkirby.com/docs/cheatsheet/options/url :wink:

According to your provider’s documentation, you can find the error log at ~/htdocs/logs/error.log.

First of all, thanks a lot for all the replies. I’m really greatful.

Logs: In contrast to the documentation, there is no logs folder at all. However, I found a log file in the backend, but there are no entries related to this issue. :frowning:

I furthermore activated the debug mode as descriped - with absolutely no effect. Where should I expect more debug infos now? I specified the URL in the config file as well - and again, nothing changed.

I’m frustrated now. :cry:

Cheers, Felix

My wife (computer scientist as well) found the problem!

We named all template-files with a leading upper case letter. But most of the content files had a leading lower case letter. The Windows XAMPP does not care about this, the public server does …

Anyway, this was easy to fix and now everything works pretty fine. I’m really happy now and I want to thank again everyone involved here for there efforts to solve my problem with kirby.

And now I’m going to purchase such a license … :slight_smile:

Cheers, Felix

1 Like

Glad, you sorted this out :smiley:

:clap:

Aha, so therefore the URL is entered there. From the documentary is not evident for a beginner. As, unfortunately, in many other points in the document as well.

I agree. The documentation of Kirby is sometimes a bit confusing and more like a collection of explanations. This is perfect, if you just want to look up a specific detail. But as a beginner I missed some kind of guide which talks you through all the basics. Nevertheless, the concepts of Kirby are very consistent and straightforward implemented. So to use Kirby is fairly easy for nerdy people like me. To be honest, I didn’t used the documentation a lot.

Cheers, Felix

@Felix: I wonder if you deleted the default.php template in the first place. Because you should not get empty pages if the file is present as it is required. From the docs

The default template is the only required template. It is called default.php and must exist in your templates folder. When you get started with a completely new site you might want to start with just the default template as your foundation.
http://getkirby.com/docs/templates/basics
(So sometimes reading the docs is quite helpful, indeed:wink:)

And we are doing our best to improve it permanently.

Ha! That could explain the problems. I did not delete that template but used it for the most common pages. So I should rename this template to something like UsualPageTemplate.php and add again the original default.php to get a proper error page?

Edit: You are right, I admit, I should have read the documentation a bit more closely. But I setted up everything together with my wife and thought she had read it. Maybe she made the same assumption for me. From this point of view, it may be not really fair when I criticize the documentation here. Nevertheless as I said before, such a straightforward implementation like Kirby may not need a much better documentation at all. It is mostly self-explaining.

Cheers, Felix

The default.php template is the template Kirby falls back to if no template with the name of the file can be found. It makes sense to leave this as basic as possible, but you can use it for your purposes, if you want to. You don’t have to rename your template and files to something else.

However, if you did not delete it, I still wonder why your pages were completely blank. The default.php template at least shows the title field or if there is no title, the UID of the page. But maybe you remove the title/text fields from the default template?

No, no, you were right as regards the documentation, I think there are still quite a few things that need more explanations, especially the more sophisticated functions. Also, a number of new functions in Kirby 2.2 are not yet documented.

Also, from the number of questions in the forum, it is obvious that not everything is self-explaining and not everyone can refer to the source code for help. While some people just don’t like documentation, others cannot find the stuff they are looking for.

After renaming most of templates etc. yesterday, I’m not able to tell you if we renamed the template to Default.php with a leading upper case letter before we uploaded everything to the public server or just yesterday. But it sounds very possible to me, since this would explain the whole behavior.

Maybe Kirby should use a special error template in a seperate folder for these error cases. This way nobody would start the website development by modifying the default template and later on forget that it has more meaning than just to be the most used template of the website. Do you understand what I mean? I’m not sure, if I explained it well enough.

Cheers, Felix

Maybe it should rather be renamed to do-not-delete-or-rename-me.php :wink:

1 Like

I agree that there should be a fallback if the default template does not exist. I have created an issue over on GitHub.

And the issue has already been fixed. There will be an error message in the next release. Thanks for reporting the issue!