4elements, web design and consultancy

As we set the stage in the previous bootstrapping article, now is the time to actually dive deep into the code, and start making changes. As an obvious choice, we'll start the editing process from the home page.

In this first article we'll be partially editing the header section. We'll edit the default wrapper files and the header.phtml file, and then we'll start editing the different components of header like currency, language selector, etc. So, without further ado, we'll start the editing process.

First of all, we’ll enable the Template hints from the admin panel, by going to System > Developer > Debug, and while doing so we'll make sure that Current Configuration Scope is set to Main Website. By enabling template hints, we’ll know
which template is responsible for the header styles. This is how the home page
will look when the template hints are on.

Here, as you can see, the outermost wrapper in which all
other files are included is coming from frontend/rwd/default/template/page/1column.phtml, which
is from the RWD theme, as we have inherited our theme from this default theme.
Instead of editing this file directly in the RWD theme, we’ll create a similar
folder in our vstyle theme at this location: frontend/tutsplus/vstyle/template/page. Then we'll copy these files into this folder, and edit them there. So, we’ll go to the frontend/rwd/default/template/page
directory and copy 1column.phtml, 2column-left.phtml, 2column-right.phtml, and
3column.phtml into this newly created folder.

Look carefully at the changes we have made in these template
files. When you compare it to the index.html file of our HTML website, it’ll
make sense to you.

This is how the website should look after editing these
files. You won’t see much difference, but we are heading in the right
direction.

Next we are going to edit the header.phtml file, as we can
see that this is the file which has the wrapper content of the header section.
So, we’ll copy the frontend/rwd/default/template/page/html/header.phtml file, move it to the frontend/tutsplus/vstyle/template/page/html folder, and start
editing it. Currently its code will look like this:

We’ll insert this HTML into the header.phtml file, and
replace difference sections with the relevant dynamic template tags like
currency switcher, store language, logo, menu, search bar, etc. This is how the
code will look after these edits:

This is how the header section will look after editing
the header.phtml file:

Now as you can see, we need to modify the code of
different sections we are using, like language and currency selector, slider,
menu, search bar, etc. To start with, we’ll edit the currency and language
selectors. If we again enable the template hints, we can see that language
selector section is coming from base/default/template/page/switch/languages.phtml, so we’ll copy this file into our theme at the same location, and start editing it
to match our HTML code. The original languages.phtml file looks like this:

As you can see, the currency selector is not showing up
on our website for now. We have to enable the currency selector from the admin
panel first. From System > Configuration > General > Currency Setup, you
have to first enable some languages, and then from System > Manage
Currency > Rates set currency rates. Then you’ll see that the currency selector
is enabled on your website. By enabling the template hints on again, we can see
that its template is rwd/default/template/directory/currency.phtml, and its
current code will look like this:

Next, we’ll edit our welcome message to match our HTML
design. For that we’ll have to go to System > Configuration/General/Design/Header/Welcome
Text. After editing this, the header will look like this:

If you have followed all the steps correctly, I hope you can see much progress in your home page's looks. Now as we have partially edited the header section, we'll continue editing the header section in the next article, and we'll also edit the main slider in that article.