This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
documentation:create_first_theme [2015/06/15 07:02] mooeditor [Option 1: Change layout in file] |
documentation:create_first_theme [2015/08/24 05:12] 127.0.0.1 external edit |
||
---|---|---|---|
Line 210: | Line 210: | ||
<font 13.3333330154419px font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17.3333339691162px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);/Arial, Helvetica, FreeSans, sans-serif;;#000000;;rgb(0, 0, 0) font-family: Arial, Helvetica, FreeSans, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17.3333339691162px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);>*</font> | <font 13.3333330154419px font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17.3333339691162px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);/Arial, Helvetica, FreeSans, sans-serif;;#000000;;rgb(0, 0, 0) font-family: Arial, Helvetica, FreeSans, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17.3333339691162px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);>*</font> | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | <div class="welcome_text"> | ||
+ | <?php echo __("Welcome to my site") ?> | ||
+ | </div> | ||
+ | |||
+ | </code> | ||
Save it then refresh your site, you will see the text changed already. | Save it then refresh your site, you will see the text changed already. | ||
Line 274: | Line 282: | ||
To use the new theme webroot: | To use the new theme webroot: | ||
- | * | + | <code> |
+ | |||
+ | app/webroot/theme/<theme_name>/css/name_file.css | ||
+ | |||
+ | </code> | ||
For example: To change style theme from blue to red | For example: To change style theme from blue to red | ||
Line 281: | Line 293: | ||
* Go to app/View/Themed/redtheme/ , copy Layouts/defaults.tpl from default to redtheme folder, then include custom.css | * Go to app/View/Themed/redtheme/ , copy Layouts/defaults.tpl from default to redtheme folder, then include custom.css | ||
- | * | + | <code php> |
+ | |||
+ | <?php | ||
+ | echo $this->Html->css( array( | ||
+ | 'custom.css?' . Configure::read('core.version') | ||
+ | )); | ||
+ | ?> | ||
+ | |||
+ | </code> | ||
* Open custom.css file then apply the new style: | * Open custom.css file then apply the new style: | ||
- | \\ * | + | <code> |
+ | |||
+ | |||
+ | #header{ | ||
+ | background: #B90000; | ||
+ | } | ||
+ | .header-bg{ | ||
+ | background: #E60000; | ||
+ | } | ||
+ | |||
+ | </code> | ||
+ | |||
* Open browser and check: | * Open browser and check: | ||
Line 299: | Line 332: | ||
To "load" the JavaScript file into your site, in the head, add something like this: | To "load" the JavaScript file into your site, in the head, add something like this: | ||
- | * | + | <code html> |
+ | |||
+ | echo $this->Html->script( array( 'file_name.js?' . Configure::read('core.version') ) ); | ||
+ | |||
+ | </code> | ||
==== JavaScript in single page ==== | ==== JavaScript in single page ==== | ||
Line 305: | Line 342: | ||
To use JavaScript inside of single page, ex: blog index page, you need to take a few more steps. Odds are that this usage is for one or only a few instances, so adding the script to the header would be unnecessary. Make sure that each script is defined inside quote: | To use JavaScript inside of single page, ex: blog index page, you need to take a few more steps. Odds are that this usage is for one or only a few instances, so adding the script to the header would be unnecessary. Make sure that each script is defined inside quote: | ||
- | * | ||
+ | <code php> | ||
+ | |||
+ | |||
+ | <?php $this->Html->scriptStart(array('inline' => false)); ?> | ||
+ | // Your code here | ||
+ | <?php $this->Html->scriptEnd(); ?> | ||
+ | |||
+ | </code> | ||
====== Export the theme ====== | ====== Export the theme ====== | ||
Line 325: | Line 369: | ||
{{:documentation:7ccc0d3367f6ef178cc7c7ca638ff0cd.png}} | {{:documentation:7ccc0d3367f6ef178cc7c7ca638ff0cd.png}} | ||
+ | |||
+ | //SAMPLE THEME:// [[https://www.moosocial.com//wiki/lib/plugins/ckgedit/fckeditor/userfiles/file/mytheme.zip|https://www.moosocial.com//wiki/lib/plugins/ckgedit/fckeditor/userfiles/file/mytheme.zip]] | ||