-
AuthorPosts
-
February 6, 2014 at 1:15 am #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 ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
February 6, 2014 at 8:04 am #521469You 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 Friendicandy_webs
- Join date:
- February 2014
- Posts:
- 82
- Downloads:
- 1
- Uploads:
- 8
- Thanks:
- 11
- Thanked:
- 12 times in 1 posts
February 9, 2014 at 4:07 am #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 Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
February 9, 2014 at 4:53 am #521890try 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 }
3 users say Thank You to chavan for this useful post
icandy_webs Friendicandy_webs
- Join date:
- February 2014
- Posts:
- 82
- Downloads:
- 1
- Uploads:
- 8
- Thanks:
- 11
- Thanked:
- 12 times in 1 posts
February 9, 2014 at 5:21 am #521891That fixed it. So I just need to make sure that I include those additional lines of code when the template updates right?
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
February 9, 2014 at 5:25 am #521892yes, you need to do this when upgrade is performed.
timmiller Friendtimmiller
- Join date:
- August 2008
- Posts:
- 169
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 12
- Thanked:
- 3 times in 1 posts
February 26, 2014 at 7:09 pm #524504Hi,
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 47I’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 Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
February 27, 2014 at 3:07 am #524552can you please attach the head.php file . so I can check and suggest
timmiller Friendtimmiller
- Join date:
- August 2008
- Posts:
- 169
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 12
- Thanked:
- 3 times in 1 posts
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
February 27, 2014 at 5:00 pm #524647can you please post your ftp details in PM
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
February 27, 2014 at 5:23 pm #524654you 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.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’; ?>” />
*/
?>[/PHP]
timmiller Friendtimmiller
- Join date:
- August 2008
- Posts:
- 169
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 12
- Thanked:
- 3 times in 1 posts
February 27, 2014 at 7:37 pm #524663Hi 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 Friendsynapsis
- Join date:
- April 2007
- Posts:
- 234
- Downloads:
- 18
- Uploads:
- 28
- Thanks:
- 58
- Thanked:
- 19 times in 1 posts
May 13, 2014 at 5:26 pm #534927I 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.
1 user says Thank You to synapsis for this useful post
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
May 14, 2014 at 3:55 am #535015Here 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'; ?>" /> -
AuthorPosts
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