Features:
Main feature: Absolute URLS from the root of project without creating controllers.
Yii 1.4 or above.
SETTING UP.
'modules'=>array( ..., 'cms'=>array( // this layout will be set by default if no layout set for page //'defaultLayout'=>'cms', ), ... ),
Set
'import'=>array( 'application.models.*', 'application.components.*', 'application.extensions.nestedset.*', // import nested set extension )
'components'=>array( ..., 'errorHandler'=>array( 'class'=>'application.modules.cms.components.CmsHandler', ), 'db'=>array( ..., 'tablePrefix'=>'', // even empty table prefix required!!! ... ), ..., 'urlManager'=>array( 'urlFormat'=>'path', .... 'showScriptName'=>false, ), ),
Copy .htaccess from archive to root directory of project
Installation database(mysql): go to cms module via route PROJECT_ROOT/cms/install Press "install database" link.
After database installed, log in, go to http://PROJECT_URL/cms/and manage your pages!!!
HOW TO MAKE HOME PAGE OF PROJECT EDITABLE VIA CMS MODULE:
put this code to your default conntroller:
public function actionIndex() { Yii::import('application.modules.cms.components.CmsHandler'); CmsHandler::renderHomePage(); }
Total 13 comments
Demo URL seams to be no longer working, where can I check it out?
I tried this module and it works like a charm on Windows server.
But when I moved my test site to Linux server it does not work.
I managed to get the cms pages to display properly but I am not able to get the admin side from where we manage pages to work properly.
What to do?
Regards,
Yogi Yang
which version of Yii are you using? Which database throws this error? I've setted my module on clean Yii 1.1.7 and everything works well...
Please describe situation.
Any idea about that error?
Getting same error as utkarshpanwar
I am new to php and yii.
I have followed all the step given above but on running it i am getting the error below, kindly let me know how to resolve this?
( ! ) Notice: Undefined variable: id in E:\wamp\www\realestate\protected\modules\cms\components\CmsHandler.php on line 11 Call Stack
Time Memory Function Location
1 0.0005 371088 {main}( ) ..\index.php:0 2 0.0210 1893056 CApplication->run( ) ..\index.php:13 3 0.0210 1893056 CWebApplication->processRequest( ) ..\CApplication.php:155 4 0.0238 2090928 CWebApplication->runController( ) ..\CWebApplication.php:121 5 0.0312 2624680 CController->run( ) ..\CWebApplication.php:328 6 0.0323 2659928 CController->runActionWithFilters( ) ..\CController.php:257 7 0.0340 2738128 CFilterChain->run( ) ..\CController.php:283 8 0.0342 2739024 CInlineFilter->filter( ) ..\CFilterChain.php:130 9 0.0342 2739088 CController->filterAccessControl( ) ..\CInlineFilter.php:59 10 0.0353 2823688 CFilter->filter( ) ..\CController.php:1088 11 0.0394 3108752 CFilterChain->run( ) ..\CFilter.php:41 12 0.0394 3108752 CController->runAction( ) ..\CFilterChain.php:133 13 0.0394 3108752 CInlineAction->run( ) ..\CController.php:300 14 0.0394 3110088 ReflectionMethod->invokeArgs( ) ..\CInlineAction.php:54 15 0.0394 3110104 CmsController->actionAdmin( ) ..\CmsController.php:0 16 0.0984 5689112 CController->render( ) ..\CmsController.php:172 17 0.0984 5689176 CController->renderPartial( ) ..\CController.php:746 18 0.0986 5689528 CBaseController->renderFile( ) ..\CController.php:833 19 0.0986 5689592 CBaseController->renderInternal( ) ..\CBaseController.php:88 20 0.0993 5746728 require( 'E:\wamp\www\realestate\protected\modules\cms\views\cms\admin.php' ) ..\CBaseController.php:119 21 0.1017 5764904 CApplication->handleError( ) ..\CApplication.php:0 22 0.1029 5798328 CApplication->getErrorHandler( ) ..\CApplication.php:714 23 0.1029 5798384 CModule->getComponent( ) ..\CApplication.php:435 24 0.1031 5799496 YiiBase::createComponent( ) ..\CModule.php:371 25 0.1042 5873160 CmsHandler->__construct( ) ..\YiiBase.php:211
Hi,great extension.I would be grateful if you could explain what is happening inside getTreeViewData function in TreeMenu class,it is used to convert a flat array of nodes into nested one.For example I have yet to grasp what the position array does or the lastitem variable.It would be very helpful to me if you could very briefely outline the logic you use to build the nested array of nodes.Thanks in advance.
Sorry, had a mistake ...
The function run can look like this:
You don't need to always add the "pageRoute" in the url field when creating pages.
I have tested your cms and it seems to be very usefull for me, thanks :-) But I have a problem with your way to activate your CmsHandler by installing your errorhandler. I have changed your code to a more "serios" way, so you don't need the errorhandler.
Changes in your CmsHandler.php 2. Add a public property
That's all.
You don't need the functions "handle()" and "initCms()" in your controller and registering your errorhandler any more.
Sideeffect/Todo:
When creating or calling pages you always have to use the prefix "content/..." in the url. Maybe this "pageRoute" can be set automatically when saving the url of the page or generating menus ...
Requirements ¶
Yii 1.4 or above. --- tis actually Yii 1.1.4 it is a good idea the project
@GOsha: Please post your comments in English, so also non-Russian-speaking users can understand, what you mean! Thank you!
This is module for managing pages - not CMS.
Looks not bad, I thisnk it will partially used in my project. Но все равно, сыровато немного выглядит. На CMS немного не тянет. Способность к расширяемости практически нулевая.
Leave a comment
Please login to leave your comment.