test
Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • lmbrst Friend
    #194514

    Hello,
    what is the best way to override the /templates/ja_university/css/template.css?

    I’ve to make some changes but don’t want loose those changes with a future update.

    Thnaks in advance.

    Ninja Lead Moderator
    #521469

    You can try to create a new CSS file which will hold your custom CSS declaration. Below are steps you can follow:

    – Open templates/ja_university/blocks/head.php file and add new script into the end of file

    <?php JHTML::stylesheet ('', 'templates/ja_university/css/custom.css') ?>

    – Create custom.css file in templates/ja_university/css/ directory and add your custom CSS rules there.

    With this approach, when you upgrade template you only need to backup head.php file.

    icandy_webs Friend
    #521887

    <em>@Ninja Lead 409776 wrote:</em><blockquote>You can try to create a new CSS file which will hold your custom CSS declaration. Below are steps you can follow:

    – Open templates/ja_university/blocks/head.php file and add new script into the end of file

    <?php JHTML::stylesheet ('', 'templates/ja_university/css/custom.css') ?>

    – Create custom.css file in templates/ja_university/css/ directory and add your custom CSS rules there.

    With this approach, when you upgrade template you only need to backup head.php file.</blockquote>

    I tried this but for some reason my css file is still not being referenced correctly

    chavan Friend
    #521890

    try adding this code in the same path templates/ja_university/blocks/head.php

    <link rel=”stylesheet” type=”text/css” href=”<?php echo JURI::base().’templates/ja_university/css/custom.css’; ?>” />

    Here is an example

    If you need to override the #ja-mainnav in this file /templates/ja_university/themes/kwahumanNJ/css/template.css

    Actual Css:

    #ja-mainnav { background: #714a42 border-top: 1px solid #7b524a }

    Type1: Try adding this css in custom.css, let try changing the background to red

    #ja-mainnav { background: #FF0000 border-top: 1px solid #7b524a }

    If Type1 is not working, try Type 2

    Type 2

    #ja-mainnav { background: #FF0000 !important; border-top: 1px solid #7b524a }

    icandy_webs Friend
    #521891

    That fixed it. So I just need to make sure that I include those additional lines of code when the template updates right?

    chavan Friend
    #521892

    yes, you need to do this when upgrade is performed.

    timmiller Friend
    #524504

    Hi,

    I’m trying the exact same thing. However I get an http error:
    Parse error: syntax error, unexpected ‘<‘ in /home/trug/public_html/dev/templates/ja_university/blocks/head.php on line 47

    I’ve added the above code on line 47 in my head.php file.

    <link rel="stylesheet" type="text/css" href="<?php echo JURI::base().'templates/ja_university/css/custom.css'; ?>" />

    I also added my custom.css page “custom.css” and put in in the correct directory (ja_university/css/).

    Can you suggest anything?

    chavan Friend
    #524552

    can you please attach the head.php file . so I can check and suggest

    timmiller Friend
    #524553

    Chavan,

    Yes it’s attached. I changed the extension to .txt.

    Thanks for taking a look.


    1. head.txt
    chavan Friend
    #524647

    can you please post your ftp details in PM

    chavan Friend
    #524654

    you forgot to conclude ?> at the end of the file. I hope this solves. I have update the files to server. Please check and confirm

    [PHP]
    <?php
    /**
    * ————————————————————————
    * JA University Template for J25 & J32
    * ————————————————————————
    * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
    * @license – Copyrighted Commercial Software
    * Author: J.O.O.M Solutions Co., Ltd
    * Websites: http://www.joomlart.comhttp://www.joomlancers.com
    * This file may not be redistributed in whole or significant part.
    * ————————————————————————
    */

    // No direct access
    defined(‘_JEXEC’) or die;
    ?>
    <script type=”text/javascript”>
    var siteurl='<?php echo JURI::base(true) ?>/’;
    var tmplurl='<?php echo JURI::base(true).”/templates/”.T3_ACTIVE_TEMPLATE ?>/’;
    var isRTL = <?php echo $this->isRTL()?’true’:’false’ ?>;
    </script>

    <jdoc:include type=”head” />

    <meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=yes”/>
    <meta name=”HandheldFriendly” content=”true” />

    <?php if (T3Common::mobile_device_detect()==’iphone’):?>
    <meta name=”apple-touch-fullscreen” content=”YES” />
    <?php endif;?>

    <?php if (T3Common::mobile_device_detect()):?>
    <meta name=”HandheldFriendly” content=”true” />
    <?php endif;?>

    <link href=”<?php echo T3Path::getUrl(‘images/favicon.ico’) ?>” rel=”shortcut icon” type=”image/x-icon” />

    <?php JHTML::stylesheet (”, ‘templates/system/css/system.css’) ?>
    <?php JHTML::stylesheet (”, ‘templates/system/css/general.css’) ?>
    <?php

    /**
    * ————————————————————————
    * Tim’s Custom CSS Redirect
    * ————————————————————————
    */

    /*
    <link rel=”stylesheet” type=”text/css” href=”<?php echo JURI::base().’templates/ja_university/css/custom.css’; ?>” />
    */
    ?>

    [/PHP]

    timmiller Friend
    #524663

    Hi Chavan,

    Right on. I took the file with the added the conclude, then removed comments and still got a php error…

    Parse error: syntax error, unexpected ‘<‘ in /home/trug/public_html/dev/templates/ja_university/blocks/head.php on line 50
    [/B]Active link here: http://truglobal.org/dev/

    <edit> I had to enable the site so I commented out this item…

    Here is the code to end of page:

    /*
    <link rel="stylesheet" type="text/css" href="<?php echo JURI::base().'templates/ja_university/css/custom.css'; ?>" />
    */
    ?>

    synapsis Friend
    #534927

    I was using JA University for the first time and created a custom.css (which is standard in all JA Templates, or so I thought), but couldn’t for the life of me figure out why my custom.css changes weren’t taking affect — until I found this forum thread. Wow. It’s not working because it’s not even looking for my custom.css? Well no wonder.

    Could you PLEASE update University to have this function by default, like you have with all of your newer templates? It’s such an easy system to utilize, I didn’t even imagine that it’s not looking for my custom.css. I thought that was a T3 default?

    Thank you.

    chavan Friend
    #535015

    @timmiller

    Here i have changed the head.php file, there was a small tweak missing.

    the below is the change i made.

    <?php
    /**
    * ------------------------------------------------------------------------
    * JA University Template for J25 & J32
    * ------------------------------------------------------------------------
    * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
    * @license - Copyrighted Commercial Software
    * Author: J.O.O.M Solutions Co., Ltd
    * Websites: http://www.joomlart.com - http://www.joomlancers.com
    * This file may not be redistributed in whole or significant part.
    * ------------------------------------------------------------------------
    */

    // No direct access
    defined('_JEXEC') or die;
    ?>
    <script type="text/javascript">
    var siteurl='<?php echo JURI::base(true) ?>/';
    var tmplurl='<?php echo JURI::base(true)."/templates/".T3_ACTIVE_TEMPLATE ?>/';
    var isRTL = <?php echo $this->isRTL()?'true':'false' ?>;
    </script>

    <jdoc:include type="head" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=yes"/>
    <meta name="HandheldFriendly" content="true" />

    <?php if (T3Common::mobile_device_detect()=='iphone'):?>
    <meta name="apple-touch-fullscreen" content="YES" />
    <?php endif;?>

    <?php if (T3Common::mobile_device_detect()):?>
    <meta name="HandheldFriendly" content="true" />
    <?php endif;?>

    <link href="<?php echo T3Path::getUrl('images/favicon.ico') ?>" rel="shortcut icon" type="image/x-icon" />

    <?php JHTML::stylesheet ('', 'templates/system/css/system.css') ?>
    <?php JHTML::stylesheet ('', 'templates/system/css/general.css') ?>
    <?php

    /**
    * ------------------------------------------------------------------------
    * Tim's Custom CSS Redirect
    * ------------------------------------------------------------------------
    */
    ?>
    <link rel="stylesheet" type="text/css" href="<?php echo JURI::base().'templates/ja_university/css/custom.css'; ?>" />

    chavan Friend
    #535017

    @synapsis

    Please use !important for your new css code. this will override the core css.

Viewing 15 posts - 1 through 15 (of 19 total)

This topic contains 19 replies, has 8 voices, and was last updated by  TomC 10 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum