|
= $this->Html->css('http://fonts.googleapis.com/css?family=Roboto:400,300,500,700'); ?>
Html->meta('icon');
$this->loadLibarary('mooCore');
echo $this->fetch('meta');
echo $this->fetch('css');
?>
element('misc/fb_include'); ?>
fetch('header'); ?>
getNgController() ?>>
=html_entity_decode( Configure::read('core.header_code') )?>
Session->flash(); ?>
fetch('content'); ?>
fetch('footer'); ?>
fetch('mooPhrase');
echo $this->fetch('mooScript');
echo $this->fetch('mooInit');
echo $this->fetch('script');
?>
element('sql_dump'); ?>
* **Webroot**
All style files are stored in **Webroot > theme**
You can style your theme by editing main.css in **webroot > theme > yourtheme > css**
By edit only files in your new theme, you are making sure that new versions that overwrite default css files will be updated without a problem (because you didn't edit those files), and those CSS changes (in the upgrade) will match new elements in the template files, then again if you're not using the default template the new rules wont affect anything
* **info.xml ** file is essential. Without it, your template won't be seen by mooSocial!. The file holds key metadata about the template.
Red Theme
red
2.0
mooSocial red theme
mooSocial
http://www.moosocial.com
====== Making Layout Customization ======
===== Customize Layout =====
If you want to change the layout of the special page, there are 2 options:
==== Option 1: Change layout in file ====
You can copy this file from default to **View > Themed > Structure file**. Remember that you must keep the directory structure and the file name to get effect, for example if you want to custom ajax_share.ctp you must copy Activities directory also, so you will have Themed ⇒
Save it then refresh your site, you will see the text changed already.
{{:documentation:87c4a40e45528af238b7a8c66f13c7dc.png}}
==== Option 2: Change layout in Admin ====
To customize the template file for custom theme, go to Admin > Themes Manager > mooSocial Base Theme, navigate to the view (template file) you want to modify ⇒ click Copy then select your theme. Click Proceed to make a copy of the template file in your theme folder (see image)
{{:documentation:bc64278948213d08654c6d3eb8d6171d.png}}
Now you can make changes to the file without affecting the base theme. Any changes made to the base theme will be overwritten when you upgrade the software.
Changes in your custom theme will not be affected after upgrading. This means you don't have to redo your changes but if the base theme was changed in the new version, your custom theme will need to be updated (manually) as well.
==== Custom layout general ====
=== Head ===
header.php - This file will contain the code for the header section of the theme; It includes all header blocks that were added at Admincp > Site Manager > Themes Manager > Layout Editor
{{:documentation:f1412f1c778589e30724c1715dbfcdfc.png}}
To add new block to header section, we can go to Admincp >
Site Manager > Themes Manager > Layout Editor
{{:documentation:3a186e965e748f88c354cd6db7affb47.png}}
=== Body Section ===
The main layout u se the Layout Editor to decide what content appears on specific pages or in your site-wide header and footer.
It decides the overall layout by deciding how many columns you want to have on this page by clicking on the “Edit Columns” button.
{{:documentation:bf7d45b2f2e53d9334dc5477406e0833.png}}
Choose a template by clicking on the template that fits your page best. The horizontal blocks on the top and the bottom represent the Site Header page and the Site Footer page, which do not need to be displayed.
{{:documentation:cc7f69a1dddad1854294d1471aff40a3.png}}
=== Footer ===
footer.php - This file will handle your footer. It includes all header blocks that were added at Admincp >
Site Manager > Themes Manager > Layout Editor
{{:documentation:5a89c49d9ea5b5d697ac9e14aa55e32f.png}}
To add new block to header section, we can go to Admincp > Site Manager > Themes Manager > Layout Editor
{{:documentation:3a186e965e748f88c354cd6db7affb47.png}}
===== Customize CSS =====
Themes can contain static assets as well as view files. A theme can include any necessary assets in its webroot directory. This allows for easy packaging and distribution of themes.
To improve performance for production environments, it’s recommended that you either symlink or copy theme assets into the application’s webroot.
To use the new theme webroot:
app/webroot/theme//css/name_file.css
For example: To change style theme from blue to red
* Go to app/webroot/theme/redtheme/css and create custom.css file
* Go to app/View/Themed/redtheme/ , copy Layouts/defaults.tpl from default to redtheme folder, then include custom.css
Html->css( array(
'custom.css?' . Configure::read('core.version')
));
?>
* Open custom.css file then apply the new style:
#header{
background: #B90000;
}
.header-bg{
background: #E60000;
}
* Open browser and check:
{{:documentation:896a9f0b758a971018bc66675e801672.png}}
===== Customize JS =====
==== JavaScript in Template Files ====
To use JavaScript repeatedly within your site, you can either set the call for the JavaScript, or the script itself, in the head of your **layout.ctp** template file, between the meta tags and the style sheet link, no differently than you would if you were using JavaScript in any HTML page.
To "load" the JavaScript file into your site, in the head, add something like this:
echo $this->Html->script( array( 'file_name.js?' . Configure::read('core.version') ) );
==== JavaScript in single page ====
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:
Html->scriptStart(array('inline' => false)); ?>
// Your code here
Html->scriptEnd(); ?>
====== Export the theme ======
To export the plugin, go to Admin > Home > Site Manager > Theme Manager, click download icon to export (See image)
{{:documentation:1072ef2faf224d5a45b4ecef6a1f219a.png}}
====== How to uninstall theme ======
To uninstall the plugin, go to Admin > Home > Site Manager > Theme Manager, click recycle bin icon to uninstall (See image)
{{:documentation:5218b868a8a4866310f781b4c419102f.png}}
====== How to install theme ======
* Copy theme source code into /app/
* Go to Admin > Home > Site Manager > Theme Manager, select tab "not uninstalled themes" and click install (See image).
{{: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]]