Professional Documents
Culture Documents
Drupal Guide E-Book
Drupal Guide E-Book
CONTENT
PAGE
11
13
14
15
17
19
19
20
: root
: password entered during installation of phpmyadmin and mysql
: whatever
: whatever
: localhost
create
insert
alter
update
index
delete
drop
ADMINISTRATION
lock table
Click GO
Step 10 :
Go to your Web Browser (Firefox)
URL : localhost/yourwebsitename
yourwebsitename = the name of folder you put inside /var/www/
Just follow the installation instruction.
Note :
an error might occur where you can't enter the drupal 7.31 installation page.
Solution :
# sudo gedit /etc/apache2/sites-available/000-default.conf
Find (CTRL + F) the line below:
DocumentRoot /var/www/html
Edit the line so that it become
DocumentRoot /var/www
=> Save & Exit, then Restart mysql & apache2
6
Open Terminal
Change directory into your subtheme.
# cd /var/www/yourwebsitesname/sites/all/themes/yoursubtheme
# drush omega-guard, [1] subtheme
For first time, it will give ERROR because we don't have the required GEM
installed. First we need bundler installed.
# sudo apt-get install bundler
To install missing Gem, just run the command below;
# bundle install
After the download and installation progress completed, you should be able to run;
# drush omega-guard
Note :
If by some bad luck you receive error's below after using the command
# bundle install
Error description :
SSL Error, Man-in-the-middle-attack
Solution :
# rvm pkg install openssl
# rvm reinstall all --force
If the problem/error still not resolved;
# rvm install 2.1.2 \ --with-openssl-dir=$HOME/.rvm/usr
(Version 2.1.3 is latest as of October 3rd, 2014)
or
# brew tap raggi/ale brew install openssl-osx-ca
Open youromegasubtheme.style.scss
//import external libraries
@import compass;
@import breakpoint;
@import singularitygs;
@import toolkit-no-css;
Edit this line into => @import toolkit;
2.
Open youromegasubtheme.normalize.scss
//use 'border-box' for the box model.
@import toolkit/border-box;
Edit this line into => @import toolkit/kickstart;
3.
10
2.
3.
4.
5.
You can choose which region to remove. For example, if you want to remove the second sidebar,
go to
the .inc file you created, in this case sidebar.layout.inc,
delete the corresponding line :
regions[sidebar_second] = Second Sidebar
You also need to delete the corresponding line from .tpl.php that you've created, in this case
sidebar-layout.tpl.php.
Delete the corresponding line :
<?php print render($page['sidebar_second']); ?>
13
The interesting things about Drupal is you can freely add or remove regions from the template. The
instructions below will guide you to add a region in your template.
Note : This will require you to make a custom template as in section 6.1.
Assuming you already done creating custom layout,
Inside the sidebar.layout.inc file, you need to define a region. Just add the following lines under
; Regions
regions[two_words] = Whatever
regions[oneword] = Whatever
Next, inside sidebar-layout.tpl.php, you need to add the following code into the .tpl.php file.
Let say you want the region to show up on Footer section, then put the code there.
<?php if ($page['two_words']): ?>
<div class="two_words">
<?php print render($page['two_words']); ?>
</div>
<?php endif; ?>
Next, for this custom region, you also need to define it in yoursubtheme.info file which can be
found inside /themes/yoursubthemes/
Just add the custom region under
; Regions Sidebar Layout ===> You can put it anywhere. I suggest on the last line of the .info file.
regions[two_words] = Whatever
regions[oneword] = Whatever
To see the changes, go to URL
localhost/yourwebsitename
Configuration > Performance > Clear Cache
Go to Appearance > Subtheme Settings > Development Tab > Select Demo Regions > Enable the
newly added region.
14
Creating custom SASS Compiling for the Custom Layout (Portable Layout)
This section will guide you to create a SASS file for the custom layouts that you've already created.
The reason is simple, you need these SASS file so that each changes only affect the corresponding
layout.
First, go to the directory (../yoursubtheme/sass/)
1.
Create a folder name layouts.
2.
Create another folder name sidebar in side the folder layouts.
Note : the name must be the same as your layout folder that you've created @ 6.1.
in this case my layout folder name is sidebar.
3.
Inside the sidebar folder, create 3 sass files with the extension .scss.
a) sidebar.layout.scss
b) sidebar.layout.no-query.scss
c) whatever-sidebar.layout.scss
What should you put into these 3 SASS files???
a) sidebar.layout.scss
@import "compass";
@import "breakpoint";
@import "singularitygs";
// Globbing from within sub-folders only works with relative paths.
@import "../../variables/**/*";
b) sidebar.layout.no-query.scss
$breakpoint-no-queries: true;
$breakpoint-no-query-fallbacks: true;
// Re-render everything from styles.scss but without media queries.
@import "sidebar.layout"; ===> this one must be the name of the main style.scss in (a).
Note :
For (a) & (b), you need to define stylesheets path inside the sidebar.layout.inc.
On the last line, add the following :
; Stylesheets
stylesheets[all][] = css/layouts/sidebar/sidebar.layout.css
stylesheets[all][] = css/layouts/sidebar/sidebar.layout.no-query.css
15
->(a)
->(b)
16
: Anything (Frontpage)
: Panel
: Selection Rule Click
Create Variant
17
18
19
20