-
AuthorPosts
-
caclemor Friend
caclemor
- Join date:
- July 2008
- Posts:
- 83
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 35
- Thanked:
- 2 times in 1 posts
September 24, 2009 at 1:04 am #144542This is a new challenge, at least for me. Working on about my 10th Joomla site with Joomlart template and the client wants three totally different looks depending on the area of the website that you are in.
What the client would like, and I am using JA_ZINC in this case, is for certain menus to have the “grass” color variation show up on those menus, the “graffiti” color variation show upon on other menus, and the “paper” color variation show up on other menus.
I know I can apply a template to various menus and have the templates change and I have loaded various templates that are totally different and made that work, but in this case, they want the color variations within JA Zinc to work by menu choice.
Little perplexed how to make this happen.
Any ideas…anyone?
mihirc Friendmihirc
- Join date:
- December 2008
- Posts:
- 597
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 62
- Thanked:
- 95 times in 39 posts
September 24, 2009 at 4:12 am #318336Hello,
I will just go to my office and tell you how to do this.
You can see it implemented on http://www.foliageoutdoors.com – Click on “Treks & Hikes” option, or the contact us page.
Regards,
Mihir Chhatre.mihirc Friendmihirc
- Join date:
- December 2008
- Posts:
- 597
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 62
- Thanked:
- 95 times in 39 posts
September 24, 2009 at 5:19 am #318339Hello,
This is a code that I used to get a css file to load for each page or sometimes even categories. I have the SEF enabled here, but you can do the same for non-SEF pages.
<?php
$currentURL = $tmpTools->getCurrentURL(); //Get the current URL
if ($currentURL =='/Adventure-Unlimited.html') {
?>
<link href="your_site/templates/ja_lead/css/grass.css" rel="stylesheet" type="text/css" />
<?php } ?>
<?php
$currentURL = $tmpTools->getCurrentURL(); //Get the current URL
if ($currentURL =='/Wildlife-Nature-Camps.html') {
?>
<link href="your_site/templates/ja_lead/css/blue.css" rel="stylesheet" type="text/css" />
<?php } ?><?php $currentURL = $tmpTools->getCurrentURL(); //Get the current URL
if ($currentURL =='/Home/') {
?>
<link href="your_site/templates/ja_lead/css/red.css" rel="stylesheet" type="text/css" />
<?php } ?>
<?php $currentURL = $tmpTools->getCurrentURL(); //Get the current URLif ($currentURL =='/Contact-Us/Foliage-Outdoors.html') {
?>
<link href="your_site/templates/ja_lead/css/yellow.css" rel="stylesheet" type="text/css" />
<?php } ?>
<?php $currentURL = $tmpTools->getCurrentURL(); //Get the current URLif ($currentURL =='/2009071646/About-Foliage-Outdoors/About-Foliage-Outdoors/about-us.html') {
?>
<link href="your_site/templates/ja_lead/css/purple.css" rel="stylesheet" type="text/css" />
<?php } ?>
Hope this helps!
Regards,
Mihir Chhatre.1 user says Thank You to mihirc for this useful post
caclemor Friendcaclemor
- Join date:
- July 2008
- Posts:
- 83
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 35
- Thanked:
- 2 times in 1 posts
September 24, 2009 at 5:50 pm #318461But where are you placing this code??
I really appreciate this insight, but which php file does this code go in??
Thanks again
mihirc Friendmihirc
- Join date:
- December 2008
- Posts:
- 597
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 62
- Thanked:
- 95 times in 39 posts
caclemor Friendcaclemor
- Join date:
- July 2008
- Posts:
- 83
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 35
- Thanked:
- 2 times in 1 posts
September 24, 2009 at 7:40 pm #318474Cool, but then you have to repeat this for every new page that you want that background to appear on…correct?
How would you code it so that it could appear for every similar section and category?
I like this but then there is a lot of staying on top stuff going on.
Appreciated the help.
mihirc Friendmihirc
- Join date:
- December 2008
- Posts:
- 597
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 62
- Thanked:
- 95 times in 39 posts
September 24, 2009 at 7:43 pm #318475Hello,
If you take a look at this code it does exactly what you want it to do. Except that I have the SH404SEF installed.
<?php $currentURL = $tmpTools->getCurrentURL(); //Get the current URL
if ($currentURL =='/Home/') {
?>
<link href="your_site/templates/ja_lead/css/red.css" rel="stylesheet" type="text/css" />
<?php } ?>
So anything that comes in the /home/ category it will get the same page as styling.Regards,
Mihir Chhatre.1 user says Thank You to mihirc for this useful post
caclemor Friendcaclemor
- Join date:
- July 2008
- Posts:
- 83
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 35
- Thanked:
- 2 times in 1 posts
September 24, 2009 at 7:49 pm #318477So here is the index.php code. Not knowing much about php, I would assume I place it after the first set of /** which contains the copyright stuff. I have inserted your code where I think it should go
[PHP]<?php
/**
* @version $Id: index.php 11407 2009-01-09 17:23:42Z willebil $
* @package Joomla
* @copyright Copyright (C) 2005 – 2009 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
<?php $currentURL = $tmpTools->getCurrentURL(); //Get the current URLif ($currentURL ==’/Home/’) {
?>
<link href=”your_site/templates/ja_lead/css/red.css” rel=”stylesheet” type=”text/css” />
<?php } ?>
// Set flag that this is a parent file
define( ‘_JEXEC’, 1 );define(‘JPATH_BASE’, dirname(__FILE__) );
define( ‘DS’, DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.’includes’.DS.’defines.php’ );
require_once ( JPATH_BASE .DS.’includes’.DS.’framework.php’ );JDEBUG ? $_PROFILER->mark( ‘afterLoad’ ) : null;
/**
* CREATE THE APPLICATION
*
* NOTE :
*/
$mainframe =& JFactory::getApplication(‘site’);/**
* INITIALISE THE APPLICATION
*
* NOTE :
*/
// set the language
$mainframe->initialise();JPluginHelper::importPlugin(‘system’);
// trigger the onAfterInitialise events
JDEBUG ? $_PROFILER->mark(‘afterInitialise’) : null;
$mainframe->triggerEvent(‘onAfterInitialise’);/**
* ROUTE THE APPLICATION
*
* NOTE :
*/
$mainframe->route();// authorization
$Itemid = JRequest::getInt( ‘Itemid’);
$mainframe->authorize($Itemid);// trigger the onAfterRoute events
JDEBUG ? $_PROFILER->mark(‘afterRoute’) : null;
$mainframe->triggerEvent(‘onAfterRoute’);/**
* DISPATCH THE APPLICATION
*
* NOTE :
*/
$option = JRequest::getCmd(‘option’);
$mainframe->dispatch($option);// trigger the onAfterDispatch events
JDEBUG ? $_PROFILER->mark(‘afterDispatch’) : null;
$mainframe->triggerEvent(‘onAfterDispatch’);/**
* RENDER THE APPLICATION
*
* NOTE :
*/
$mainframe->render();// trigger the onAfterRender events
JDEBUG ? $_PROFILER->mark(‘afterRender’) : null;
$mainframe->triggerEvent(‘onAfterRender’);/**
* RETURN THE RESPONSE
*/
echo JResponse::toString($mainframe->getCfg(‘gzip’));
[/PHP]mihirc Friendmihirc
- Join date:
- December 2008
- Posts:
- 597
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 62
- Thanked:
- 95 times in 39 posts
September 25, 2009 at 3:34 am #318513Hello,
Well no.
Basically after all that, there is a <head> tag.
You need to put the above code inside the head tag,Can you attach your index.php and i will just add that code for you there, and mark it so that you can just change it to what you want later.
Mihir.
caclemor Friendcaclemor
- Join date:
- July 2008
- Posts:
- 83
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 35
- Thanked:
- 2 times in 1 posts
September 25, 2009 at 3:46 pm #318573Sure thing but I don’t see a head tag in this file but I am no php guy. thanks for the help
<em>@mihirc 146185 wrote:</em><blockquote>Hello,
Well no.
Basically after all that, there is a <head> tag.
You need to put the above code inside the head tag,Can you attach your index.php and i will just add that code for you there, and mark it so that you can just change it to what you want later.
Mihir.</blockquote>
-
AuthorPosts
This topic contains 10 replies, has 2 voices, and was last updated by caclemor 15 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum