1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
How to install this Content Management Module in your Yii application:
1.) Extract the archive into your protected/modules folder.
2.) Import the docs/schema_mysql.sql to the mysql Database that your
Application runs. Only one table, called 'sitecontent', will be inserted.
$ mysql -u root -p < docs/schema_mysql.sql -D database_name
Add the module to your application Configuration.
[...]
'modules' => array(
'cms' => array(
'languages' => array('en', 'de') // <-- languages you want to allow
)
),
[...]
If you want to use the layout of your existing Web Application, set the layout
to an empty string, or null:
'layout' => null,
Otherwise an lightweight default layout of the cms will be used.
Administrate your Content by using
http://app/index.php?r=cms/sitecontent/admin
or, when using a Route configuration, possibly
http://app/index.php/cms/sitecontent/admin
Please not that a 'sitecontent'-entry acts as a sitecontent as well as a
menu point.
In order to let your Application render the content at appropriate places,
do is like this:
// This will render a <ul><li>-based Menu containing all child elements of
// the menu points.
Cms::renderMenuPoints($id_of_the_sitecontent_page);
Use Cms::render($page, $language) to render sitecontent everywhere you want
in your views, models or controllers:
// render sitecontent page 3
<?php echo Cms::render(3); ?>
// render sitecontent page with the url_title footer
<?php echo Cms::render('footer'); ?>
// render sitecontent page with the url_title footer in _french_.
// note that, by default, cms::render tries to resolve the page in the
// language of Yii::app()->language:
<?php echo Cms::render('footer', 'fr'); ?>
Please also read CmsModule.php for additional configuration options.
Feel free to contact me at:
skype: herbertmaschke
icq: 38541423
email: thyseus@gmail.com
yii-forum username: thyseus
|