0
Welcome Guest! Login
0 items Join Now

SOLVED :: HowTo add css from a subdirectory in css directory

  • SOLVED :: HowTo add css from a subdirectory in css directory

    Posted 14 years 8 months ago
    • with the following code I can add the file demo-sytels.css to my template
      $gantry->addStyle("demo-styles.css");
      the file demo-styles.css is situated in <template>/css

      for some reason I have to move the file to a subdir
      <templates>/css/component/demo-styles.css
      I tried to add the css file to my template again
      $gantry->addStyle("component/demo-styles.css");
      But this doesn't seem to work
      nor does the following
      $gantry->addStyle("component'.DS.'demo-styles.css");

      What code do I have to use when a CSS file is placed in a subdir of the CSS directory.
    • Last Edit: 14 years 8 months ago by Jira ICT.
  • Re: SOLVED :: HowTo add css from a subdirectory in css directory

    Posted 14 years 8 months ago
    • Let's try the classic way :)
      Open your template index.php at:
      <Joomla Root>/templates/<your template name>/index.php

      Find below codes:
       
      </head>
       

      Change the codes to:
       
      <link href="<?php echo $this->baseurl; ?>/path/to/your/file.css" rel="stylesheet" type="text/css" />
      </head>
       
  • Re: SOLVED :: HowTo add css from a subdirectory in css directory

    Posted 14 years 8 months ago
    • Thank you for your quick reply, but it's not the solution I'm looking for.
      I've created a new php file and placed it into features, so Gantry can make use of it. (see attachement->
      This attachment is hidden for guests. Please log in or register to see it.
      )

      It seems that a cannot use addStyle to add a css file situated in a subdirectory of css... or can I?
  • Re: SOLVED :: HowTo add css from a subdirectory in css directory

    Posted 14 years 8 months ago
    • Jira ICT wrote:
      Thank you for your quick reply, but it's not the solution I'm looking for.
      I've created a new php file and placed it into features, so Gantry can make use of it. (see attachement-> magebridge.php.zip)

      It seems that a cannot use addStyle to add a css file situated in a subdirectory of css... or can I?
      Oh, I see. Yes, we can.
      Could you please try using this:
      $gantry->addStyle($gantry->templateUrl."/css/component/custom.css");
  • Re: SOLVED :: HowTo add css from a subdirectory in css directory

    Posted 14 years 8 months ago
    • thanks... that works like a charm

Time to create page: 0.060 seconds