Super Fast Joomla Intro Tutorial - Amherst Web Design

tumwaterpointlessInternet and Web Development

Dec 4, 2013 (3 years and 7 months ago)

71 views

Super Fast Joomla Intro Tutorial
Thursday, 13 May 2010 05:27
So... here are some Joomla "primer points"...

 

Joomla is a web development framework that
bundles PHP and Javascript libraries together with core code.  Joomla is open source, so...
don't buy a book on Joomla if you can read PHP and Javascript... read the code instead.  Also,
it's extendible so there are plenty of examples (good and bad) out there to review.

 

To answer the question "Is Joomla a CMS?", one must first ask, "Is navigation content?".  Since
I'm not equipped to answer that little riddle, I'll just leave it at "Joomla is a framework that
manages content, it's structure, and how it is presented and navigated.  It provides for
administration as well as presentation."

 

If I thought I had the one super-link for learning the vocabulary of Joomla, I'd paste it here. 


This one is a pretty good:
http://docs.joomla.org/Framework


 

A better "general Joomla dev reference" bookmark I use is:
http://docs.joomla.org/Developers

 

Here's my helpful, insightful guide to the vernacular:

 

COMPONENT

Every web page has a "thing".  When you take off all the columns, dressings, menus, banners,
footers it usually all boils down to some "thing".  In Joomla, that "thing" is the component (or one
might say, 'an instance of a Joomla component').

 

Let that soak in a little because it's big.  I mean sure, nothing will stop you from making a page
with  just a bunch of modules (I'll define them later, but suffice to say they ain't components). 
You just normally, 99.999999% of the time wouldn't do it.  There's always a "thing".  A bit of
content, a calendar, an image, or sometimes a very complex thing.  The article you are
presently reading is this web page's "thing".

1 / 6
Super Fast Joomla Intro Tutorial
Thursday, 13 May 2010 05:27

It is
one of two ways to think about what we mean when we say "web page"
.  Likewise, I think of the page's component as
one
of the ways to think about a "web page" in Joomla.  (The other is as a menuitem, more on that
soon...)

 

TEMPLATE

Joomla doesn't deviate far from the standard use of this term.  Templates are something that
whole, entire websites have.  Every Joomla website has a default template and that is the
template that the world sees.  A Joomla website can't NOT have a template.  Templates live in
the "templates" directory. 

 

Read this tutorial
to build your own, minimal Joomla template.

 

Each template has one really, really important file called "index.php".  It is, unabashedly,
simultaneously, every single page of the site (not including administration).  It's the Joomla
equivalent to the asp Master page. And inside of just about any sane Joomla template
index.php file, somewhere in the html body you will see a line exactly like this:

 
<jdoc:include type="component"></jdoc:include>
 

That's where the "thing" renders.  The "component".  It is generally unconditional.

 

You can find all of the Joomla components in the directory called "components" (Joomla is
always doing that: naming directories just exactly for what is in them... and I sure do appreciate
that.  The problem at the beginning of course, is that you wouldn't know if something were a
"module" or a "plugin" right off the bat.)

 

Unless you read on...

2 / 6
Super Fast Joomla Intro Tutorial
Thursday, 13 May 2010 05:27
 

And, trust me on this one, the Mother of all components in Joomla, is the content component:
com_content. 

 

SECTIONS, CATEGORIES, ARTICLES

Like a blog, the "generic" content in a Joomla websites is kept in articles (a database object,
there is no directory of articles).  Each article has a Category, and each Category has a
Section.  This is kind of a big deal, so again the hierarchy for organizing content in Joomla is:

 

Section->Category->Article

 

How we decide to use, or not use this hierarchy when laying out the content has huge
ramifications (I assert) in the amount of time and effort that will be spent populating, and
maintaining the site's content.

 

Joomla allows "uncategorized" articles, but one can also think of them as in Section
"uncategorized" and Category "uncategorized".

 

EXTENSIONS

Joomla has, essentially, four kinds of extensions.  One kind is the "template", we already know
about those. 

 

Another kind is "custom component", and hey... we already know about components (at least, a
little).  I once said that "custom components" were the pearly-back-door too Joomla.  They can
range from simple form-handling to complex, multiple-view applications and they can do pretty
much anything.

 

That leaves two other kinds: modules and plugins.  Of the two, I find much more utility in
modules.
3 / 6
Super Fast Joomla Intro Tutorial
Thursday, 13 May 2010 05:27

 

MODULES

Remember all that dressing I was throwing away to get to the "thing"?  Let's look at it again. 
This is stuff we generally find in columns, dynamic footers, navigation, breadcrumbs, and more. 
Generally speaking, in Joomla these are "modules" (and by now, I suppose you would know
what directory to find them in!)

 

They have names like mod_thingy, and not all modules are custom: many come with Joomla. 
Thinking about it, pretty much every thing you see on a joomla web page *besides* the
component is a module: menus, banners, breadcrumbs, latestnews, login, column-teasers, etc.

 

When you create a module, you specify it's POSITION. 
Now, this is something I didn't figure out right away but is very important
: that dropdown box in the module edit screen is NOT just a dropdown.  You can type in it to
create a new position, like "foobar123".

 

Then you can (conditionally) render that position in your template/index.php file with code like
this:

 
<?php if($this->countModules('foobar123')) : ?> <div class="foobar"> <jdoc:include
name="foobar123" type="modules"> <div> <?php endif; ?>
That first line is checking to see if *this page* has anything to display in that position.

 

So when you create/edit a module, you not only decide about its position, but also what pages it
appears on.  The way you do this is by multi-selecting menu items in a list, or selecting "all". 
For this reason, I find it is much better to,
as much as possible, setup all menus at the beginning of development
.  Otherwise, unless the module is global (and they rarely are... do we really want the login
module on the new user registration page?), you'll keep having to edit modules to see them on
the pages as you link new pages in.

 

Another important thing to know about is the "Custom HTML" module type.  Create a new
4 / 6
Super Fast Joomla Intro Tutorial
Thursday, 13 May 2010 05:27
module of this type and you basically get the article content editor.

 

A FINAL NOTE ABOUT THE TEMPLATE DIRECTORY TREE:

You can override pretty much all of the standard, Joomla markup using the technique explained
in this article (for an example, I did this for com_contact in BDIW): 
http://docs.joomla.org/Understanding_Output_Overrides
.  Explains how to copy component (and other) views and override them without messing in the
Joomla core code.

 

MENUS

Menus (and their associated menuitems) are the other way to think about a "web page" in
Joomla.  SEO, and many other things about the page are controlled via the configured
menu-item parameters.  For me, I had a hard time knowing at first whether to look for a given
parameter in the component, module, or menu-item.  If you study the parameters (and types) of
menu items a little before diving in too far I think this helps.  Just created a dummy menu item
and look at your choices for type and params.

 

Remember: it's good practice to
never link the same content from two menus
.  That is what the "Alias" menu type (way at the bottom of your type choices) is for.  This
prevents duplicate paths to the same content, and is especially important for SEO.

 

PLUGINS

These are more rare, lower-level extensions to Joomla.  Think "triggers" and "events".  If you
need to do X every time Y happens, you are probably thinking about a plugin.  Language
management (babelfish), and stuff like that.

 

Finally, here are some other links from my Joomla link folder that you might find interesting:

 

http://docs.joomla.org/JPath
 (pathing cheat sheet)
5 / 6
Super Fast Joomla Intro Tutorial
Thursday, 13 May 2010 05:27

http://docs.joomla.org/How_to_use_user_state_variables
 (like the PHP session, but Joomla-style)

http://docs.joomla.org/Component_parameters
 (perhaps more than you want to know about them...)


Have fun! 
6 / 6