Please note that the forum isn't realy used anymore.

If you have questions, want support or just simply want to talk to us you can find us on slack.

 

No layout when changing themes

Hello,

I wanted to install another theme. I installed the Panakeia and Chameleon themes and uploaded them succesfully. But when I select them and view a page I don't see any layout, just plain text. The only theme that works is the Triton one.

What might I be doing wrong?

Thanks in advance

Hi, are you working with debug mode set to true (/app/config/parameters.yml)? It disables cache and a few other things.

Try to clear the cache manually too. If you are working on a mac/linux, go to your fork cms root folder with terminal and execute sh tools/remove_cache. Does this help?

I just edited the parameters.yml, changing kernel.debug: false to true and also cleared cache manually, but still no change unfortunately.

I'm running Fork CMS 3.7 and panakeia theme and it displays fine. However, I noticed that when you open the source code, you'll see something like this:

<link rel="stylesheet" href="/src/Frontend/Themes/panakeia/Core/Layout/Css/screen.css" />

Notice that starting from Fork CMS 3.7 the foldernames must be capitalized (for the transition to the symfony framework). Panakeia still uses lowercase folder names (panakeia/core/layout/css/screen.css) but my browser still loads it, although in the html source the path is written with capitals. Maybe this is causing your problem? Triton has already capitalized folder names.

Try to copy the url of the screen.css and visit it in your browser. If the url with capitals doesnt load, try visiting a lowercase url. Does it load?

I tried visiting the screen.css both with capitals and lowercase, but neither of them shows a proper layout.

I went in the sourcecode but I have <link rel="stylesheet" href="/src/Frontend/Core/Layout/Css/jquery_ui/jquery_ui.css" /><link rel="stylesheet" href="/src/Frontend/Cache/MinifiedCss/e28e30f68261ed1baa039a097c296377.css" />

so it's different from what yours displays (though I also get this when I use the triton theme).

Are you sure that debug is set to true? When debug mode is on, you get the url like I posted (the url is the direct link to the screen.css from the template folder), when debug is off you get a minified css url from the cache folder. You can easily check if debug is enabled, by going to the fork cms backend and you'll see a red message saying "Debug mode". Have you tried clearing your browsercache too?

My bad, it seems my file wasn't uploaded so debug wasn't set to true. I corrected it, so now I'm in debug mode, but still no layout :/

What i get from the source code now is this:

<link rel="stylesheet" href="/src/Frontend/Core/Layout/Css/jquery_ui/jquery_ui.css" /><link rel="stylesheet" href="/src/Frontend/Core/Layout/Css/screen.css" /><link rel="stylesheet" href="/src/Frontend/Core/Layout/Css/debug.css" />

Thats strange, it can't find the Panakeia css file so it uses the default css from the frontend core. Can you browse to:

http://yourdomainnamehere.com/src/Frontend/Themes/panakeia/Core/Layout/Css/screen.css or http://yourdomainnamehere.com/src/Frontend/Themes/panakeia/core/layout/css/screen.css

If not, check with your ftp program if the panakeia folder exists in the /src/Frontend/Themes folder and it has all the files. Be sure to check if src/Frontend/Themes/panakeia/core/layout/css/screen.css exists.

If you installed the theme with the .zip upload functionality in Fork CMS, it could be that the module files aren't copied to your webserver for example because the folder permissions weren't set to write access. Did you upload the module from the zip?

I can visit the URL with the caps. It gives me the website without layout again, but with an error stating the XML-file doesn't contain any associated style-information. The URL with the lowercase gives me a bunch of text/code.

I uploaded the theme from the .zip file and the screen.css file is indeed on the server.

I tried uploading another theme, but this time I unzipped it and uploaded it directly using ftp. Going to the backend the theme can be viewed, but when I want to install it, it says that 'this item does not exist'. (By the way, when I click on 'details' on the panakeia theme it also says that the item doesn't exist).

Is it possible to send the url of the website that you're having problems with, I'll try to figure out what's wrong and then I can visit the url's myself.

sure: www.ka-yu.be/contact or www.ka-yu.be/over-ons

for example; but www.ka-yu.be or the 'home' tab will redirect you to the current site

thanks in advance :)

@Jonas: That CSS file is empty by default, right?

@Error5221: Are you sure that every file is uploaded? I can open almost every file from your panakeia url but I can't open files from the panakeia/core folder, like the css file, so does it exist?

But I can't open any file from the panakeia/core folder?

Can you take a screenshot of your ftp program where I can see your /src/Frontend/Themes/panakeia/core folder? I think it's missing some folders or files in it. The layout should work when you're able to open the two links (above)...

Right, my mistake. Indeed the theme screen.css is missing.

Here are some screenshots. I honestly have no idea whether or not I'm missing any files.

http://www.ka-yu.be/shot1.PNG http://www.ka-yu.be/shot3.PNG http://www.ka-yu.be/shot4.PNG http://www.ka-yu.be/shot5.PNG

I can both open the screen.css file and scripts.js file. Screenshots 4 and 5 show the contents.

edit: can't seem to figure out right now how to turn the text into actual links so I'll leave it like this for now..

Looking at the base theme, triton, the "core" folder and their subfolders must have capital first letter.

Changed names of folders so they have capital first letter (though Jesse suggested this earlier as well). The screen.css and scripts.js files can be viewed in the browser.

But going to eg http://www.ka-yu.be/contact gives an exception: Message The template (/home/kayu/domains/ka-yu.be/publichtml/app/../src/Frontend/core/layout/templates/homewarm.tpl) does not exists. File /home/kayu/domains/ka-yu.be/public_html/src/Frontend/Core/Engine/Theme.php

Am i perhaps doing something else wrong?

Can you check the paths for the templates in the database table themes_templates, if those are set correctly (with capital first letter)?

changed the paths in database with capital first letter. Still no layout (though I don't get an exception anymore).

Now, on top of the page I get {include:core/layout/templates/head.tpl} {include:core/layout/templates/header.tpl} and at bottom {include:core/layout/templates/footer.tpl}

Those paths should also be with capital first letter, in the homewarm.tpl file, also check the other template files.

Basically, the whole template needs to be converted to work with Fork CMS 3.7. All the filenames should start with capital letter (no underscores; CamelCasing) as well as some directories (Css, Js, Core, Layout for example). Inside the (.tpl) files you should also adjust the filename like jonasdk89 says. Compare the theme against the Triton theme to know the differences.

PS. I don't think it's a lot of work, but I would suggest to wait with Fork CMS 3.7.0 until 3.7.1 is released in a few weeks/months. The 3.7 version has a lot of file renaming and thus a few bugs were discovered. If you don't want to continue converting the theme (but it's not that hard), you can download the previous Fork CMS 3.6.6 release and Panakeia should be working fine without errors :p

Aah, finally. The layout works ! (changing the filenames to ones with first capital letter and adjusting the paths in the .tpl files did it) Thanks both of you for the help ! :D

So al this was a bug from the 3.7 version?

Not a bug, your theme, that you are using, was not yet upgraded for Fork CMS 3.7 :)

Yeah, and most of the modules and themes on the Fork website are not yet ready/converted for version 3.7... That's gonna take a while I think.

Each module/theme should have their specifications listed (supported versions, ...) on this website. I have no idea (without downloading) which modules are supported for 3.7 and which not.

I don't understand why backwards compatibility wasn't considered when updating to the new version. Does anyone know of a guide which can explain exactly what to change in a theme to have it work with the new version? I'm new to using this CMS and I don't want to have to read the entire manual just to test out a new theme.

What theme do you want to use? I upgraded a few, but they're not yet on the website.

Fork CMS version 3.7 & 3.8 were major upgrades to the cms. Fork CMS is slowly converting to a full-stack Symfony framework application. Symfony is a well-known PHP framework and has a large community, which means that someone who knows the Symfony framework, can develop Fork CMS modules (or Core) very easily and they don't have to learn a lot. So hopefully, the Fork community of users & developers will grow (a lot!), which means more modules, themes, core features will be developed.

The developers are slowly adding Symfony components and are refactoring/removing the old code from the CMS. A lot of the code in Fork CMS was programmed from scratch. By replacing them with Symfony components, they use code that has been tested by hundreds/thousands of Symfony users, so less bugs (!) and more possibilities/features. Fork CMS (still) uses the Spoon library, a php library that was written by some of the people who worked on Fork CMS. The library isn't being developed anymore, so the developers are trying to remove (in each version they release) as much code that uses Spoon and replace them with Symfony components. (e.g. the templates will be .twig files in the future, and not the old Spoon .tpl files, the SpoonDatabase will be replaced with Doctrine, ...).

In version 3.7 the most important changes were composer autoloader (in the past, Fork used a custom autoloader) and added namespaces. They needed to start using capital/CamelCased letters. That's why all the old themes (and modules) are not compatible. To upgrade a theme, you need to take a look at the default Triton theme and see what files&folders are capitalized, and then capitalize the files in the theme that you want to upgrade. Also the info.xml, the css file with paths to images, the paths inside tpl files etc should be checked and modified to use capital letters where needed.

I upgraded the following themes: Panakeia, Eco, Response2, Divan, OpenGray, GoldenGate and a few more, but the website has to be updated to serve the new updated themes. So it's best to search & download themes on github. The Bootstrap theme is also upgraded to the latest versions of Fork.

If you are looking for a theme with the basic code & layout to start creating your own theme, check out Potnoodle. It uses the Chopstick responsive design framework.

In the future, the themes will use .twig templates so then they all need to be upgraded AGAIN. But I understand that new Fork users want to download a theme now, and they can't because they're not compatible, so that's why I upgraded most of the themes.

Comment

The forum is deprecated in favor of our Slack channel, which provides real-time support for your issues.

Join us on Slack here: https://fork-cms.herokuapp.com/