test
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • caclemor Friend
    #144542

    This 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 Friend
    #318336

    Hello,

    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 Friend
    #318339

    Hello,

    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 URL

    if ($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 URL

    if ($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.

    caclemor Friend
    #318461

    But where are you placing this code??

    I really appreciate this insight, but which php file does this code go in??

    Thanks again

    mihirc Friend
    #318462

    Hello,

    It would go in your index.php inside the head tags!

    Mihir.

    caclemor Friend
    #318474

    Cool, 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 Friend
    #318475

    Hello,

    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.

    caclemor Friend
    #318477

    So 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 URL

    if ($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 Friend
    #318513

    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.

    caclemor Friend
    #318573

    Sure 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>


    1. index.txt
Viewing 10 posts - 1 through 10 (of 10 total)

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