Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Problems with the CMS backend, when developing a new theme

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1239 Views
  • CriaturaCreativaStudio
    Avatar
    Community Member
    73 Posts

    Problems with the CMS backend, when developing a new theme Link to this post

    Hello there!

    Mi name is Eduardo Cesario, you may know me by my Organica Creativa design on Zen Garden.

    I'm developing a very basic site, my first one using the cms. Everything it's going quite well.
    I'm runing MAMP on a Macbook Pro.

    When i've updated the files to let the CMS know wich theme use (in my case, called "redjeans"), the previews looks ok, but the problem ocurrs when i want to log in agian on the cms to continue adding contents into it.
    The backend uses also my new theme! i want to mantain the original theme for the backend, mainly because when the final client use the site, it will be a mess if it doenst display correctly.

    i've edited two files as follows:

    mysite/_config.php

    SSViewer::set_theme('redjeans');

    mysite/code/Page.php

       Requirements::themedCSS("never_styles");

    and deleted the 3 original lines (wich are the blackcandy files). I dont know how to manage this, it's weird that i've lost all the original theme for the backend.... maybe i'm doing something wrong, so i ended up here, becuse im tired to reconfigure the 2 files each time i want to swicth to the backoffice.

    (for you to know, yes, i refreshed the urls using flush=1)

    hope someone could help me

    best regards and thanks!

    Eduardo

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Problems with the CMS backend, when developing a new theme Link to this post

    Its strange that the backend is including your CSS. Is that Requirements::themedCSS() in the function init() in the Page_Controller class?.

    Normally the CMS can be styled from your theme but using a file called editor.css and typography.css - maybe create those 2 files - leave them blank but see if the cms is still playing up

  • CriaturaCreativaStudio
    Avatar
    Community Member
    73 Posts

    Re: Problems with the CMS backend, when developing a new theme Link to this post

    hello willr....thanks for your answer...

    seems like i dont understand the cms structure at all... i alternativelly have or my "redjeans" theme for all the site (live site and cms), or the blackcandy for both parts...

    Anything i'm doing is wrong.

    I don't understand how the backend manages the blackcandy style, since i'm specifying the new style on the config file... i alternatively have one visualization or the other.. never the two as i'm specting...

    i have this line on mysite/_config.php

    SSViewer::set_theme('redjeans');

    on mysite/code/Page.php

    .....
    class Page_Controller extends ContentController {
       function init() {
          parent::init();
          Requirements::themedCSS("layout");
          Requirements::themedCSS("typography");
          Requirements::themedCSS("editor");
          
          Requirements::themedCSS("never_styles");
       }
    .....

    As it is, now im seeing my theme both in the site and the backend...

    I'm tried referencing only my new styles, and it dindt work too, so last configuration ive tried is reference all the 4 stylesheets.

    Hope you can help me wiht this issue, it's driving me mad

    Regards

    Eduardo

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Problems with the CMS backend, when developing a new theme Link to this post

    Requirements::themedCSS("layout");
    Requirements::themedCSS("typography");
    Requirements::themedCSS("editor");
    Requirements::themedCSS("never_styles");

    Have you got a layout.css , typography.css and editor.css in the yourtheme/css/. If you aren't using them then you dont need to include them. But if they are not there then it shouldnt use your css file thats just odd!.

    What is changing in the backend? is it just the font sizes or color.

    You could try copy all your styles from never_styles to layout.css and then see if it effects the backend.

  • CriaturaCreativaStudio
    Avatar
    Community Member
    73 Posts

    Re: Problems with the CMS backend, when developing a new theme Link to this post

    Wilr,

    I've noticed that once logged in, things look good, i mean, with blackcandy theme...

    I've managed this issue remaining logged in (and using the "remember password" feature), so i log directly to the cms every time i visit the /admin url.

    So i Alternatively edit the config.... file, for the theme to display. It's a very basic workaround, but it helped me to develop almost the complete site.

    Anyway, i would love to know how to fix this issue... maybe i re-styled some class that uses the cms itself...

    Regards

    Eduardo

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Problems with the CMS backend, when developing a new theme Link to this post

    maybe i re-styled some class that uses the cms itself...

    The CMS will include 2 files from your theme - typography.css and editor.css if you have those 2 files and any styles in them then yes that would effect your CMS.

    1239 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.