A guide to creating Mambo 4.5.1 - 4.5.3 and Joomla 1.0.x templates in Dreamweaver with our free mambo dreamweaver template builder extension and Mambo Stand Alone Server [MSAS] from www.mambosolutions.com or Joomla Stand Alone Server (JSAS) from Joomlasolutions.com
So, you have discovered this great tool called Mambo and you want to try to make your own Mambo template huh? Well, I know how you feel and share your enthusiasm. Back in 2002 I was working with Xoops, a similar system to Mambo, and after I discovered Mambo, it did not take long for me to switch and have a go at making my own Mambo templates. At that time there were no tutorials around the web, so like others, I looked at the existing default templates for Mambo and started reverse engineering. Here, I will attempt to clearly layout the steps in creating a Mambo template so that you may have a nice resource that was not available when I got started. Well, what are we waiting for? Lets get started at the beginning, I find that is usually a good a place as any to get started.
First of all, lets talk about what a mambo template is. A mambo template defines the overall 'look and feel' of your mambo website. Normally this includes things like, colors, header image, 2 or 3 column layout, footer etc. The template (index.php) works hand in hand with the CSS (template_css.css) to give you control over many things such as module placement, font colors, borders, hyperlink hover effects, and a gazillion other things that you will discover if you dig deeper.
There are many ways to go about creating/designing a Mambo template. In this guide, we will be creating a 100% width 'autostretch' 3 column table layout. The layout is 3 seperate 100% tables 'stacked' vertically-the top table is for the header area, the middle table is for the mambo left, center and right columns, and the bottom table is for the footer area. Additionally, the middle table will contain a 3 column 100% nested table.
We will be using Dreamweaver to to the first phase of the layout and coding. After we reach a certain point, we will switch over to our local Mambo test server [MSAS] to preview how our template will actually look on the web. Ok enough overview already right? You want to start making a template...comon!
Update: Joomla! is a seprate application but shares the same templates as Mambo at this time. (Mambo 4.5.1 - 4.5.3 same as Joomla 1.0.x templates) Joomla! was created when the entire mambo development team split from mambo and started this new project called Joomla!. More info at www.joomla.org
Some time, perhaps 1 hour - maybe more, maybe less
Perhaps a beverage (optional-I am using Maestro Lorenzo brand coffee today)
Windows 2000 or XP
Actually, I have added copy/paste snippets of code for Mac/Linux/non Windows people :) So read on....
First Phase, we need to open Dreamweaver and get the template builder extension installed.
*note: If you need to download the newest version of the extension manager from Macromedia, get it here
Open Dreamweaver. On the top menu, locate 'Commands' then 'manage Extensions'. This will open the extension manager.
In the extension manager, choose 'File' then 'Install Extension'. Browse to the location of the mambosolutions451a2.mxp and install it.
After installation, exit the Dreamweaver application.
Now restart Dreamweaver. You should see a new toolbar titled' MamboOS'
Figure 1: Mambo Toolbar in Dreamweaver
If you are with me to this point, pat yourself on the back, grab a tasty beverage (your choice), and get ready for the second phase of setting up your local template development environment: MSAS !
note: you can also use JSAS, the screens will look slightly different but the basics are same
Second Phase. [MSAS] Let's get our local server environment running so we can play Mambo!
Mambo is a web applictaion that is dependant on other web applictaions to create its magic. Namely MySql database, PHP and Apache webserver. Actually we dont need to worry about the extra steps of installing and configuring all of those applications because luckily I have created for you an 'all-in-one' server package based on MiniServer for Windows called 'Mambo Stand Alone Server' or [MSAS].
Put your hands in the air and say'Yeah mambosolutions!' :) Ok, if you don't put your hands in the air its up to you.
If you haven't already done so, download
MSAS -save it to your desktop
install it as as you would any appliaction
locate the msas.exe(inside the Distribution folder) then double
click
At this point you should see the MSAS inteface window on your desktop
Login/Password for Mambo administrator: admin/admin
Figure 2: MSAS Interface
Whew! are you having fun yet? Man I sure am. OK time for me to grab a coffee. BRB!
Allrighty then, finally we get to the template building part....
Let's see how mambosolutions builds a template, shall we?
I am sure that there are several different ways to go about building a mambo template. In fact, I know there are. My goal here is to show you in the simplest way I know how, to create a basic mambo template using tables, inserting all the mambo jambo code with my dreamweaver extension, and creating a sort of 'live preview' environment using MSAS. Sound ok? Will the code validate? Probably not. Will it show you the basic idea of how mambo templates work and how you can create one? I sure hope so! Lets roll....
Third Phase : Building a 3-column table template for Mambo
Step 1: Head's Up!
Open Dreamweaver and create a new 'dynamic page' --> php
Figure 3: New Document in Dreamweaver
Switch to Code view and you should have something like this:
Figure 4: Code View in Dreamweaver
Select all the code above the closing </head> tag and delete it
Figure 5: Delete head code in Dreamweaver
Insert the mambo Head code by locating and clicking on the 'Insert Head Code' button in the Mambosolutions451 toolbar
Your code should now look like this:
Figure 6: Insert Mambo Head Code in Dreamweaver
MAMBO 4.5.1 TEMPLATE HEAD CODE (copy/paste from below)
Step 2: John, John young and able, get your elbows off the table!
Ok, hopefully my tutorial is better then my humor. Lets layout some tables for our template.
Switch over to 'Design View' in Dreamweaver.
Click once anywhere in the white area on the canvas to activate the cursor
We will be creating 3 seperate tables at 100% with for an varaible width 'auto-stretch' template. The top table will be for our header area; the middle table will be for our left middle and right content columns; and the bottom table will be for our footer area.
From the top menu, go to Insert>Table (Ctrl+Alt+T) This brings up the table dialouge box
Enter the following settings:
Figure 8: Insert Table Dialogue in Dreamweaver
Repeat this process a total of three times - until you have 3 tables stacked vertically at 100% width each
TIP: Locate the 'Layout' tab, and choose 'Expanded' view-this is optional but I find it helps you see what you are doing better.
Figure 9: Expanded Design View in Dreamweaver
Click once in the middle table to select it
Next, go to ' Insert' >'Table' (CTRL+ALT+T) and create a 3 column 100% width table
Figure 10: Insert nested table in Dreamweaver
Now you should be looking like this:
Figure 11: Nested 3 column table in Dreamweaver
can you begin to see how the template layout is functioning? We will now resize the left and right cells of this table - these will be our left column and right column in the template-the middle area will be for the main content.
place your cursor in the left cell and click to select it
in the Properties, enter 18% for the width (18% is the width I chose, but you can later adjust this what you want)
While your here, set the vertical align to 'Top'
Click in the right column, repeat this step for the right column
see below:
Figure 12: Resize columns in Dreamweaver
Step 3: Calling all Code Monkeys! Now we can start inserting the mambo specific php code in our templates, don't worry if you don't know the difference between PHP and a hole in the ground, this will be painless!
Locate the Insert Main Body code button on the Mambosolutions451a extension toolbar in Dreamweaver
Click once anywhere in the middle column?Main Content Area' to select it-then click the Insert Main Body button
for those of you on Macs or Linux, the 'Main Body'code to insert at this point is:
Below is codeview of the table layout code with the Mambo 'Main Body' code (with added comments)
Okay, so how are we doing so far? Are you getting it? I sure hope so because this is taking a heck of a lot longer than I had thought it would. Normally anything worth doing means taking the time to do it right, and in this case that means a long time :)
Let's continue adding code, shall we?
Click once in the left column to select it, then click on the Insert Left Modules button to insert the following code:
Cool? did you get that?
Let's go ahead and add 'user1' module position directly underneath the 'left' position
Make sure the code placeholder is not selected while in wysiwyg mode by clciking anywhere in the white are of the left cell.
Locate the Insert User1 Modules position button and click it to insert the following code in the left column:
Now let's jump over to the right column, click anywhere in the right column to select it
Locate the Insert Right Modules position button and click it once to insert the code:
Now lets add the User2 position below the 'Right' position, make sure the code placeholder is not selected while in wysiwyg mode by clciking anywhere in the white are of the right cell.
Locate and click once on the Insert User2 button to insert the User2 php code:
Our tables in 'code view' should look like this about now:
Figure 13: Tables layout with Mambo php code added in Dreamweaver
Let's insert the search code, (note: search is now a module in Mambo 4.5.1- so this is optional if you want to hardcode it in the template)
We are going to be placing the search field at the top of the right column for now just for learning purposes
In the right column, where you just added the code for positions 'Right' and 'User2', click your mouse to the left of the first php code placeholder
Figure 14: Insert cursor to the left of the existing code placeholder in Dreamweaver
Click once on the 'Insert Search' button to insert the Search code
It should look like this:
Figure 15: Search field in Dreamweaver
Moving right along, let's add our banners area.
Click anywhere in the bottom table (footer table) to select it.
Center align our banners by clciking the Center Align in Properties panel:
Figure 16: Align center in Dreamweaver
Click once on the 'Insert Banners' button to insert the banners code:
Lets put our Footer code in as well:
Make sure the code placeholder is not selected while in wysiwyg mode by clicking anywhere in the white are of the bottom table. In fact to place the footer below the banners, just click to the right of the code placeholder.
Insert the footer code by clicking on the Insert Footer button
Thats it for the footer, lets move up to the header area, shall we?
We will be creating a new nested table in the top 'header' table for the pathway and the date display
Click anywhere in the top table to select it
From theDreamweaver top menu, Insert a new 2 column 100% width table by going to Insert>Table
Click once in the right cell of the new table, go to Properties Inspector and manually set the width to 30%
Figure 17: Date and Pathway
With your cursor in the right column of the top table, click on Insert Date button
Now lets add our 'breadcrumb trail', or Pathway
Click anywhere in the left column of the top header table to select that cell
Locate and click on the Insert Pathway button
Well then, I guess you are getting anxious to see how this is all going to look in Mambo, right? I know I sure am...but remember -so far we have been creating the layout of our template and adding the php code snips that will let Mambo do its dynamic content magic. We have not done any design yet, so don't not expect to see an awesome looking template...in fact at this stage it is bare bones text and tables!
Phase Four: Creating our template directory structure in Mambo and moving over to MSAS.
A mambo template is structured as follows.
Figure 18: Directory structure of a template
Start MSAS.exe if it is not already running
Navigate to the templates directory of Mambo in MSAS
W:\www\mambo45\templates
Create a new folder and name it 'ms_dwtutorial'
Open this folder named 'ms_dwtutorial' , and create 2 folders-one
named 'css' and one named 'images'
Save this file we have been working in Dreamweaver as index.php
in the 'ms_dwtutorial' folder
Next we
need to create our templateDetails.xml file Create a new xml (plain
text file with .xml extension on windows), copy the code below in
it and place it in the 'ms_dwtutorial' folder-save it as 'templateDetails.xml'
Next its time to create the stylesheet that will control the things like font style, colors, link rollovers, borders around content, etc....the almighty template_css.css
Open the CSS folder and create a new css file named 'template_css.css'
Copy/paste the following css into the 'template_css.css file and save it.
For a list of all the CSS styles used in Mambo 4.5 check out this great list that Visualdensity put together