SiteCake 2.4.10 combined with included php pages

#1

Hello everyone!

SiteCake looks like a great product, that why my companion and I bought it to use it in our projects.
We’re using 2.4.10 but changes I make, as a test, do not get saved so I’m trying to figure out how SiteCake works when saving/publishing to better understand what is going wrong.

Our set-up is as follows:
index.php

  • does general stuff
  • include header.php
  • include ‘filename.php’ which is given as variable ‘filename’ from: domain.ext/filename ( without .php )
  • include footer.php

So to give a few examples ( remember https: // is in front of it, but as new member I can only do 2 links ) :

  • domain.ext and domain.ext/home will include ‘home.php’ into ‘index.php’
  • domain.ext/portfolio will include ‘portfolio.php’ into ‘index.php’
  • domain.ext/contact will include ‘portfolio.php’ into ‘contact.php’

Is it a config / setting I need to change that I’ve missed, or can’t SiteCake edit contents of pages that are included via php?

//Edit: sitecake/2.4.10/config/requirements.php shows: Basic server configuration needed for Sitecake to run is OK

Thanks in advance!

#2

Hm. You should check permissions. See the point #9
https://sitecake.com/docs/reasons-for-error-500.html

#3

Hello Nik,

Thanks for you’re answer and sorry for my late reply, since I only work on wednesdays for myself and my companion, my reaction is now.

I’ve looked through the reasons and will name and check them 1 by 1.
I’ve removed ‘http://’ and ‘https://’ due to being a new member and not being able to paste all my links.

1. Do you have an index.html page?

As explained in my initial post, I have an ‘index.php’ the includes the other files, such as:

<?php
include_once './paginas/header.php';
$filename = './paginas/'.$_GET['page'].'.php';
if (file_exists($filename)) {
    $include_path = $filename;
} else {
$include_path = './paginas/404.php';
}
include_once $include_path;
include_once './paginas/footer.php';
?>

2. Is your HTML valid?

It wasn’t, but it is now: validator.w3.org/nu/?doc=https%3A%2F%2Frosegaar-sitecake.caprover.rootsafe.nl%2F
Except for a few “Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections” warnings on a few pages.

3. Check if you uploaded all files from the Sitecake zip

Double checked by extracting from “sitecake-2.4.10-whitelabel.zip” overwriting all existing files and then changing password and timezone.

4. Is your basic server configuration ok?

rosegaar-sitecake.caprover.rootsafe.nl/sitecake/2.4.10/config/requirements.php shows “Basic server configuration needed for Sitecake to run is OK

5. Too many php files, libraries, folders with unnecessary stuff

I reckon I’m ‘safe’ but please let me know if otherwise.

------------ /var/www/html ------------
   26.3 MiB [##########] /assets
   10.6 MiB [####      ] /sitecake
    2.7 MiB [#         ] /images
    1.1 MiB [          ] /fonts
    1.0 MiB [          ] /css
  788.0 KiB [          ] /js
  224.0 KiB [          ] /paginas
   12.0 KiB [          ] /inc
    4.0 KiB [          ]  index.php
    4.0 KiB [          ]  .htaccess
    4.0 KiB [          ]  admin.php

6. Too many, too large images

The largest file in ‘assets’ is a “6.7M” PDF file, the largest image is “568K”.
The PDF is only linked to via a:

<a href="..">link</a>

7. Don’t mix Wordpress blog and Sitecake website

Not the situation

8. Do not keep more than one website in the Sitecake root folder

Not the situation

9. Permissions issue

Not an issue.

Files:

find -type f -exec stat -c%a {} \; | sort | uniq -c | sort -n
      4 755
   1185 644

Directories:

find -type d -exec stat -c%a {} \; | sort | uniq -c | sort -n
    281 755

10. If everything else fails open sitecake.log

Well, it doesn’t throw any errors, so sitecake.log isn’t created.
It just doesn’t save changes, I’m loading rosegaar-sitecake.caprover.rootsafe.nl (/admin.php) ( /var/www/html/index.php ) that includes home.php ( /var/www/html/paginas/home.php ) and the changes to ‘home.php’ aren’t saved.

When going to /admin.php it breaks the ‘basehref’ and adds whitespaces, so certain images aren’t loaded, please see s3.eu-central-1.wasabisys.com/public-random/BeeldOpname-2021-05-12_11.45.17.mp4 for the screen footage


What else can I do, is SiteCake not compatible with the ‘include’ structure/method?
If further research is need, I can provide the password via a secured way to the Sitecake team.

#4

A couple of advices:

Rename home.php into something else. Sitecake is looking for

  • index.htm, index.html, index.php
  • default.htm, default.html, default.php
  • home.htm, home.html, home.php

as a website start page. If it founds several start pages it might mess things.

Use sc-content-footer, sc-content-header as Sitecake repeaters if you want to repeat some content throughout the website. Edit just on one page and Sitecake will propagate changes. You do not need PHP includes for that.

RewriteBase in .htaccess may mess things up too.

#5

If you are not able to fix things please open a ticket and share loging credentials with us.

#6

Thank you @Nik I’ve created ticket 3466 and will await response.

#7

Hello @Nik first of all, thanks for you’re reaction in the ticket too.

So if I understand you correctly SiteCake can only work when the pages are seperated in the ‘root’, is that correct?

So like:

/assets
/css
/images
/js
/fonts
/inc
/sitecake
index.php
admin.php
home.php
portfolio.php
.. and so on ..

Or is it only meant for one-page websites with just an index, default or home file?

So like:

/assets
/css
/images
/js
/fonts
/inc
/sitecake
index.php
admin.php
#8

Sitecake can manage one-page website and also a 20+ page website. But you can’t have index.php and home.php in the same website. Index, home and default are reserved names for the first page of the website and if you have more than one Sitecake does not know where to start.