hi all
i use theme and i but it in theme folder
but when i try to move index.php to subfolder the theme crash and the page display without theme
how can i tell themeManager to update baseUrl by add some code in config file
thank you
hi all
i use theme and i but it in theme folder
but when i try to move index.php to subfolder the theme crash and the page display without theme
how can i tell themeManager to update baseUrl by add some code in config file
thank you
1-You need to call your current them path
put path in your layout like this :
<link href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/rs-plugin/css/settings.css" media="screen" />
2- Edit your config and add defult theme :
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
//'name'=>Yii::t('app','SiteTitle'),
'theme'=>'theme-en', // folder name
// preloading 'log' component
//'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
'sourceLanguage' => '00',
'language' => 'en',
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'0',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
),
.............
?>
thank you but it still not work
the key is in
‘themeManager’ =>‘baseUrl’
but i can’t update it
http://localhost/webroot/subfolder/themes/themename/css/*
where
subfolder place where i but index.php file
First you need to reread about themes , second check my project them structure I hope will help
Also read :
-protected
-themes
--mytheme
-subfolder
--index.php(index in subfolder)
index.php(main index)
i use mytheme in main index all thing good
but in index.php file (index in subfolder )
i try to use mytheme but it display only info
and if you view source code of page
it look like this
-
-
-
-
<link rel="stylesheet" type="text/css" href="/webroot/subfolder/assets/8229aca1/main_old.css" />
-
-
-
-
<link href="/webroot/subfolder/themes/mytheme/css/style.css" rel="stylesheet">
-
-
-
i need to tell the code to use main assets and theme in webroot not in subfolder
I hope if I explained well
thank you