0
Welcome Guest! Login
0 items Join Now

Add settings to gantry

  • Add settings to gantry

    Posted 10 years 6 months ago
    • Hello there

      I am currently busy doing some css on an osmosis template for work and I was wondering is there a way to add the usual settings for my new position in the template, I want to make it easy for my boss and for myself if I could add properties for my position in the backend template manager, the usuall settings like background color and font color?

      Could someone please help me?
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: Add settings to gantry

    Posted 10 years 6 months ago
    • Really I wouldn't bother - it will create more work for you and it will make it really hard to take updates to the template as you would have to keep reapplying all your changes that you made to our original template files.

      Keep all custom styling changes in a custom CSS file - it's by far the easiest way.

      This is how to create a custom CSS compatible with Gantry 4...

      Simply create a file called "<TEMPLATENAME>-custom.css" and put this file in the CSS folder of the template (where <TEMPLATENAME> is the name of the template as seen in template manager e.g. rt_fracture). GANTRY4 will automatically load this CSS file. If you wish, you can also have browser specific files by appending, for example, "-ie9" making the filename "<TEMPLATENAME>-custom-ie9.css"

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Add settings to gantry

    Posted 10 years 6 months ago
    • Thank you for replying so fast, I know how to add the rt_osmosis-custom.css file, but the thing is, it would be nice as it would make my work much easier, if our designers could just edit the colors in the template manager, we never update our gantry framework, as we use the ones included with the template. So it would still be nice if I could just add the few lines of extra code.

      Thanks
      JH Viljoen
    • DanG's Avatar
    • DanG
    • Preeminent Rocketeer
    • Posts: 36750
    • Thanks: 3229
    • Custom work done

    Re: Add settings to gantry

    Posted 10 years 6 months ago
    • JHViljoen wrote:
      Thank you for replying so fast, I know how to add the rt_osmosis-custom.css file, but the thing is, it would be nice as it would make my work much easier, if our designers could just edit the colors in the template manager, we never update our gantry framework, as we use the ones included with the template. So it would still be nice if I could just add the few lines of extra code.

      Thanks
      JH Viljoen

      You could try this, you can import a style sheet from within another stylesheet. Better yet, you can import any number of styles this way. So your document’s head section would include this:

      <link rel="stylesheet" type="text/css" href="/css/tempsheet.css" />

      Then your “tempsheet.css” document can contain calls to any number of additional style sheets:

      @import url('/css/color1.css');
      @import url('/css/color2.css');
      @import url('/css/color3.css');

      All three CSS files above will be loaded from this single stylesheet tempsheet.css. Your @imports statements must come before all other content in your CSS. Even putting comments before the @import tag will cause your imports to fail. So be sure to do your imports before you do anything else.

      Once you've completed the project you should finalize the settings in the Template Manager and remove the tempsheet.css as this method does slow loading a bit.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: Add settings to gantry

    Posted 10 years 6 months ago
    • JHViljoen wrote:
      Thank you for replying so fast, I know how to add the rt_osmosis-custom.css file, but the thing is, it would be nice as it would make my work much easier, if our designers could just edit the colors in the template manager, we never update our gantry framework, as we use the ones included with the template. So it would still be nice if I could just add the few lines of extra code.
      You absolutely should be keeping your gantry-framework up-to-date - we release bug fixes and security fixes regularly so the gantry framework included in the rocketlauncher may not be the latest. The same applies for the template itself.

      If you really want to start modifying the template to add extra options - then the files you need to change are template-options.xml, index.php and all the LESS files in the less directory to use those options (you will need to understand html, php, less, css and xml to do this). This seems like an awful lot of work to me when you could just add a single line of CSS to do the same. We deliberately don't put every conceivable permutation of styling and color options into template manager as it would make it too complex and (taking it to it's logical conclusion) your would effectively be reproducing CSS.

      Of course, as soon as you start modifying original template files you are then going to have problems with updates, as any update will overwrite the original files again.

      So, my advice is still to use custom CSS instead.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.063 seconds