Replace colour selections with new static block

Hi guys, like most of us once we have chosen a colour for our site we want to remove the colour options and i would like to replace them with another static block.

Can someone please explain the process.

Thanks in advance.

16 answers

Profile photo of thangnn1510 0.00 $tone July 22, 2011
Public

Hi Cameron!

Please replace this code:

<?php if ( $tmpTools->getParam("usertool_color", ‘4’) == "4" ) : ?>
<li class="level0 parent" >
<a onmouseout="toggleMenu(this,0)" onmouseover="toggleMenu(this,1)" href="#"><span>Minisite’s Color</span></a>
<?php echo $tmpTools->genToolMenu ($tmpTools->getParam(‘usertool_color’),’txt’); ?>
</li>
<?php endif; ?>

in app\design\frontend\default\your_templatetemplate \catalognavigationtop.phtml with your own code.

#1
Profile photo of cameron ferris 0.00 $tone July 22, 2011
Public

hi thangnn, thanks for the reply

the code i have in that file is --
?>
<?php
/**
* Top menu for store
*
* @see Mage_Catalog_Block_Navigation
*/
global $tmpTools;

?>
<div class="header-nav-container">
<div class="header-nav">
<h4 class="no-display"><?php echo $this->__(‘Category Navigation:’) ?></h4>
<ul id="nav" class="clearfix">
<?php if ($tmpTools->isHomepage()===FALSE) {
$homecls=’class="nav-home"’;
} else {
$homecls=’class="nav-home active"’;
}
?>
<li <?php echo $homecls;?> onmouseout="toggleMenu(this,0)" onmouseover="toggleMenu(this,1)" >
<a href="<?php echo $this->getUrl(”) ?>" title="Home"><span>Home</span></a>
</li>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
</ul>
</div>
<?php echo $this->getChildHtml(‘topLeftLinks’) ?>
</div>

What would i replace it with ?

#2
Profile photo of thangnn1510 0.00 $tone July 23, 2011
Public

Hi Cameron!

You should find this code:

<?php if ( $tmpTools->getParam("usertool_color", ‘4’) == "4" ) : ?>
<li class="level0 parent" >
<a onmouseout="toggleMenu(this,0)" onmouseover="toggleMenu(this,1)" href="#"><span>Minisite’s Color</span></a>
<?php echo $tmpTools->genToolMenu ($tmpTools->getParam(‘usertool_color’),’txt’); ?>
</li>
<?php endif; ?

in that file and replace it with your code:

<li><a href="your link">you title</a></li>

Tell me if you need more help.

Thank you.

#3
Profile photo of cameron ferris 0.00 $tone July 23, 2011
Public

hi again, bit strange this but as i cant attach a phtml file here is the whole code complete
you can see that what you mention should be there isnt -- therefore to replace code that isnt there is not really possible.

<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design_default
* @package Mage
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* Top menu for store
*
* @see Mage_Catalog_Block_Navigation
*/
global $tmpTools;

?>
<div class="header-nav-container">
<div class="header-nav">
<h4 class="no-display"><?php echo $this->__(‘Category Navigation:’) ?></h4>
<ul id="nav" class="clearfix">
<?php if ($tmpTools->isHomepage()===FALSE) {
$homecls=’class="nav-home"’;
} else {
$homecls=’class="nav-home active"’;
}
?>
<li <?php echo $homecls;?> onmouseout="toggleMenu(this,0)" onmouseover="toggleMenu(this,1)" >
<a href="<?php echo $this->getUrl(”) ?>" title="Home"><span>Home</span></a>
</li>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
</ul>
</div>
<?php echo $this->getChildHtml(‘topLeftLinks’) ?>
</div>

ANY IDEAS ? thanks

#4
Profile photo of thangnn1510 0.00 $tone July 26, 2011
Public

Hello. I have checked your site. it is app/design/frontend/default/jm_oganis/template/catalog/navigation/top.phtml. The below is its code:

Code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php 
/**
 * Top menu for store
 *
 * @see Mage_Catalog_Block_Navigation
 */
  global $tmpTools; 
   
  class JA_InlineMenu extends Mage_Catalog_Block_Navigation {
  	/**
     * Enter description here...
     *
     * @param Mage_Catalog_Model_Category $category
     * @param int $level
     * @param boolean $last
     * @return string
     */
    public function extendDrawParentItem($category, $level=0, $last=false, $id)
    {
        $html = '';
        if (!$category->getIsActive()) {
            return $html;
        }
        if (Mage::helper('catalog/category_flat')->isEnabled()) {
            $children = $category->getChildrenNodes();
            $childrenCount = count($children);
        } else {
            $children = $category->getChildren();
            $childrenCount = $children->count();
        }
        $hasChildren = $children && $childrenCount;
        
        $html.= '<li id="parent_menu'.$id.'" ';
        if ($hasChildren) {
             $html.= '';
        }

        $html.= ' class="level'.$level;
        $html.= ' nav-'.str_replace('/', '-', Mage::helper('catalog/category')->getCategoryUrlPath($category->getRequestPath()));
        if ($this->isCategoryActive($category)) {
            $html.= ' active';
        }
        if ($last) {
            $html .= ' last';
        }
        if ($hasChildren) {
            $cnt = 0;
            foreach ($children as $child) {
                if ($child->getIsActive()) {
                    $cnt++;
                }
            }
            if ($cnt > 0) {
                $html .= ' parent';
            }
        }
        $html.= '">'."n";
        $html.= '<a onmouseover="toggleMenu(this,1); hideAllMenu(); displayChildMenu('.$id.');" onmouseout="toggleMenu(this,0);" href="'.$this->getCategoryUrl($category).'"><span>'.$this->htmlEscape($category->getName()).'</span></a>'."n";
        
        $html.= '</li>'."n";
        
        return $html;
    }
     
    /**
     * Enter description here...
     *
     * @param Mage_Catalog_Model_Category $category
     * @param int $level
     * @param boolean $last
     * @return string
     */
    public function extendDrawChildItem($category, $level=0, $last=false)
    {
        $html = '';
        if (!$category->getIsActive()) {
            return $html;
        }
        if (Mage::helper('catalog/category_flat')->isEnabled()) {
            $children = $category->getChildrenNodes();
            $childrenCount = count($children);
        } else {
            $children = $category->getChildren();
            $childrenCount = $children->count();
        }
        $hasChildren = $children && $childrenCount;
        
        $html.= '<li ';
        if ($hasChildren) {
             $html.= '';
        }

        $html.= ' class="level'.$level;
        $html.= ' nav-'.str_replace('/', '-', Mage::helper('catalog/category')->getCategoryUrlPath($category->getRequestPath()));
        if ($this->isCategoryActive($category)) {
            $html.= ' active';
        }
        if ($last) {
            $html .= ' last';
        }
        if ($hasChildren) {
            $cnt = 0;
            foreach ($children as $child) {
                if ($child->getIsActive()) {
                    $cnt++;
                }
            }
            if ($cnt > 0) {
                $html .= ' parent';
            }
        }
        $html.= '">'."n";
        $html.= '<a onmouseover="toggleMenu(this,1)" onmouseout="toggleMenu(this,0)" href="'.$this->getCategoryUrl($category).'"><span>'.$this->htmlEscape($category->getName()).'</span></a>'."n";
        
        $html.= '</li>'."n";
        
        return $html;
    }
  }
  
  $jaMenuObj = new JA_InlineMenu();
  
?>
<?php if ($tmpTools->isHomepage()===FALSE) 
{
	$homecls='class="nav-home"';
} else {
	$homecls='class="nav-home active"';
}

?>

<?php if ( $tmpTools->getParam("ja_menu", 'css') == "css" ) { ?>

<div class="header-nav-container<?php if ($tmpTools->isHomepage()): echo "-hilite"; endif; ?> inner">
    <div class="header-nav clearfix">
        <h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4>
        <ul id="nav" class="clearfix">
        <li <?php echo $homecls;?>>
			<a <?php echo $homecls;?> href="<?php echo $this->getUrl('') ?>" title="Home"><span>Home</span></a>
        </li>
        <?php foreach ($this->getStoreCategories() as $_category): ?>
            <?php echo $this->drawItem($_category) ?>
        <?php endforeach ?>
        <?php if ( $tmpTools->getParam("usertool_color", '4') == "4" ) : ?>
        <li class="level0 parent" >
        	<a onmouseout="toggleMenu(this,0)" onmouseover="toggleMenu(this,1)" href="#"><span>Oganis's Color</span></a>         
            <?php echo $tmpTools->genToolMenu ($tmpTools->getParam('usertool_color'),'txt'); ?>
        </li>
        <?php endif; ?>
		<li>
            <a  href="<?php echo $this->getUrl('contacts') ?>" title="Contact Us"><span>Contact Us</span></a>
        </li>
        </ul>
    </div>
    <?php echo $this->getChildHtml('topLeftLinks') ?>
</div>

<?php }else { ?>

<div onmouseout="rollbackCurrentMenu()" class="header-nav-container<?php if ($tmpTools->isHomepage()): echo "-hilite"; endif; ?> inner">
    <div class="header-nav clearfix">
        <h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4>
        <ul id="nav" class="clearfix">
        <li <?php echo $homecls;?>>
					<a <?php echo $homecls;?> href="<?php echo $this->getUrl('') ?>" title="Home" onmouseover="hideAllMenu();"><span>Home</span></a>
        </li>
        <?php $i=0; foreach ($this->getStoreCategories() as $_category): ?>
            <?php echo $jaMenuObj->extendDrawParentItem($_category, 0, false, $i); $i++; ?>
        <?php endforeach ?>
        <?php if ( $tmpTools->getParam("usertool_color", '4') == "4" ) : ?>
        <li id="parent_menu9999" class="level0 parent">
        	<a href="#" onmouseout="toggleMenu(this,0);" onmouseover="toggleMenu(this,1); hideAllMenu();  displayChildMenu('9999'); " ><span>Oganis's Color</span></a>
        </li>
        <?php endif; ?>
        <li>
            <a  href="<?php echo $this->getUrl('contacts') ?>" title="Contact Us"><span>Contact Us</span></a>
        </li>
        </ul>
    </div>
    <?php echo $this->getChildHtml('topLeftLinks') ?>
</div>


 <div onmouseout="rollbackCurrentMenu()" id="ja-subnav" class="clearfix">
    	<?php $i=0; foreach ($this->getStoreCategories() as $_category): ?>
            <?php 
            	if (Mage::helper('catalog/category_flat')->isEnabled()) {
		            $children = $_category->getChildrenNodes();
		            $childrenCount = count($children);
		        } else {
		            $children = $_category->getChildren();
		            $childrenCount = $children->count();
		        }
		        
		        if( $childrenCount > 0 ){
		        	if ( ! $this->isCategoryActive($_category) )
		        		echo '<ul class="subnav-item clearfix" id="child_menu'.$i.'" style="display:none" onmouseover="hideAllMenu();  displayChildMenu(\''.$i.'\');" >  ';
		        	else
		        		echo '<ul class="subnav-item clearfix" id="child_menu'.$i.'" style="" rel="active_menu" onmouseover="hideAllMenu();  displayChildMenu(\''.$i.'\');" > ';
		        	foreach ($children as $child) {
		        		echo $jaMenuObj->extendDrawChildItem( $child );
		        	}
		        	echo '</ul>';
		        }
		        $i++;
            ?>
        <?php endforeach ?>
        
        <?php if ( $tmpTools->getParam("usertool_color", '4') == "4" ) : 
	        echo '<div class="subnav-item" id="child_menu9999" style="display:none" onmouseover="hideAllMenu(); displayChildMenu(\'9999\');">';
	        echo $tmpTools->genToolMenu ($tmpTools->getParam('usertool_color'),'txt'); 
	        echo '</div>';
         endif; 
        ?>
        
    </div>

<?php } ?>
#7
Profile photo of cameron ferris 0.00 $tone July 26, 2011
Public

This must be where there is an issue.

That domain doesnt even have the template for jm_oganis uploaded so im not sure how you found it there.

this forum is for jm epidio

the path to file im using is /httpdocs/app/design/frontend/default/jm_epidio/template/catalog/navigation

Code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php 
/**
 * Top menu for store
 *
 * @see Mage_Catalog_Block_Navigation
 */
  global $tmpTools; 
  
?>
<div class="header-nav-container">
    <div class="header-nav">
        <h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4>
        <ul id="nav" class="clearfix">
        <?php if ($tmpTools->isHomepage()===FALSE) {
				$homecls='class="nav-home"';
			} else {
				$homecls='class="nav-home active"';
			}
		?>
        <li <?php echo $homecls;?> onmouseout="toggleMenu(this,0)" onmouseover="toggleMenu(this,1)" >
					<a href="<?php echo $this->getUrl('') ?>" title="Home"><span>Home</span></a>
        </li>
        <?php foreach ($this->getStoreCategories() as $_category): ?>
            <?php echo $this->drawItem($_category) ?>
        <?php endforeach ?>
        </ul>
    </div>
    <?php echo $this->getChildHtml('topLeftLinks') ?>
</div>

Does anyone else think they can help with this issue?

#8
Profile photo of thangnn1510 0.00 $tone July 27, 2011
Public

Hi Cameron!

The site you send me is http://www.lifestyle-impex.co.uk/ it is JM Oganis. For JM Epidio please do this:

-- Open .phtml files under app\design\frontend\default\jm_epidiotemplate\pag e
-- Replace this code:

Code:

		  <div class="head"><h4>Epidio Color</h4></div>
		 	<?php echo $tmpTools->genToolMenu ($tmpTools->getParam('usertool_color'),'txt'); ?>

with

Code:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_static_block')->toHtml() ?> ')->toHtml() ?>

-- Login to admin and create a static block with id "your_static_block".

You could change "your_static_block" with ID of the static block you created.

Thank you.

#9
Profile photo of cameron ferris 0.00 $tone July 27, 2011
Public

thanks thangnn, im glad we sorted out where the confusion lay.

ive tried to implement your advice here but the code you give throws up errors in Dreamweaver.

Should i ignore them ?

#10
Profile photo of cameron ferris 0.00 $tone August 2, 2011
Public

Here is the code error i mentioned.

Any ideas ?

And are you saying i need to edit the following phtml files ? --
1 column
2 columns-left
2 columns-right
3 columns
dashboard
one-column
print
re-direct

#16

This question is now closed

Written By

Comments