Error 404
Posted:
26 Sep 2015, 13:39
by Ashwini
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
Re: Error 404
Posted:
30 Sep 2015, 11:15
by Koduc
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('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('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');
}