Error 404

Questions and answers about change of functions, design, hosting etc.

Moderators: Koduc, Xpycm

Forum rules
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

Error 404

Postby Ashwini » 26 Sep 2015, 13:39

when Error 404 is occurred , then how to hide Search form box from this page...
Display only error on this page , hide search box and menubar from this page
Ashwini
Passer
 
Posts: 44
Joined: 03 Aug 2015, 12:41
Reputation point: 0

Re: Error 404

Postby Koduc » 30 Sep 2015, 11:15

Open file
/themes/classic/layouts/main.php and replace
Code: Select all
        if(!isset($adminView)){
        ?>
            <div id="search" class="menu_item">
                <?php
                
if (param('useYandexShare'0))
                    
$this->widget('application.extensions.YandexShareApi', array(
                        
'services' => param('yaShareServices''yazakladki,moikrug,linkedin,vkontakte,facebook,twitter,odnoklassniki')
                    ));
                if (
param('useInternalShare'1))
                    
$this->widget('ext.sharebox.EShareBox', array(
                        
'url' => Yii::app()->getRequest()->getHostInfo().Yii::app()->request->url,
                        
'title'=> CHtml::encode($this->seoTitle $this->seoTitle $this->pageTitle),
                        
'iconSize' => 16,
                        
'include' => explode(','param('intenalServices''vk,facebook,twitter,google-plus,stumbleupon,digg,delicious,linkedin,reddit,technorati,newsvine')),
                    ));

                    
/*$this->widget('zii.widgets.CMenu',array(
                        'id' => 'dropDownNav',
                        'items'=>$this->aData['topMenuItems'],
                        'htmlOptions' => array('class' => 'dropDownNav'),
                    ));*/

                    
$this->widget('CustomMenu',array(
                        
'id' => 'sf-menu-id',
                        
'items' => $this->aData['topMenuItems'],
                        
'htmlOptions' => array('class' => 'sf-menu'),
                        
'encodeLabel' => false,
                        
'activateParents' => true,
                    ));
                
?>
            </div>
        <?php

to
Code: Select all
        $showMenu = true;
        if(Yii::app()->controller->route == 'site/error'){
            $showMenu = false;
        }

        if(!isset($adminView)){
            if($showMenu){
        ?>
            <div id="search" class="menu_item">
                <?php
                
if (param('useYandexShare'0))
                    
$this->widget('application.extensions.YandexShareApi', array(
                        
'services' => param('yaShareServices''yazakladki,moikrug,linkedin,vkontakte,facebook,twitter,odnoklassniki')
                    ));
                if (
param('useInternalShare'1))
                    
$this->widget('ext.sharebox.EShareBox', array(
                        
'url' => Yii::app()->getRequest()->getHostInfo().Yii::app()->request->url,
                        
'title'=> CHtml::encode($this->seoTitle $this->seoTitle $this->pageTitle),
                        
'iconSize' => 16,
                        
'include' => explode(','param('intenalServices''vk,facebook,twitter,google-plus,stumbleupon,digg,delicious,linkedin,reddit,technorati,newsvine')),
                    ));

                    
/*$this->widget('zii.widgets.CMenu',array(
                        'id' => 'dropDownNav',
                        'items'=>$this->aData['topMenuItems'],
                        'htmlOptions' => array('class' => 'dropDownNav'),
                    ));*/

                    
$this->widget('CustomMenu',array(
                        
'id' => 'sf-menu-id',
                        
'items' => $this->aData['topMenuItems'],
                        
'htmlOptions' => array('class' => 'sf-menu'),
                        
'encodeLabel' => false,
                        
'activateParents' => true,
                    ));
                
?>
            </div>
                <?php
            
}


Open file /themes/classic/layouts/inner.php and replace
Code: Select all
if($this->showSearchForm){
    
$this->renderPartial('//site/inner-search');
}
 

to
Code: Select all
if(Yii::app()->controller->route == 'site/error'){
    
$this->showSearchForm false;
}

if(
$this->showSearchForm){
    
$this->renderPartial('//site/inner-search');
}
 
-- Меньше знаешь - крепче спишь --
User avatar
Koduc
Team lead
Team lead
 
Posts: 64
Joined: 28 Dec 2011, 09:11
Reputation point: 0


Return to Questions and help for changes

Who is online

Users browsing this forum: No registered users and 37 guests