New to joomla coding - need tips for extension development

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
plainas
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 27, 2008 12:53 pm

New to joomla coding - need tips for extension development

Post by plainas » Wed Feb 27, 2008 1:31 pm

Hey all,
This is my very first contact with joomla, hope this is a fun and interesting coding experience.

I am an experienced PHP developer and I need to develop a simple extension ( not quite sure if this is the correct name ) to joomla! I must confess I always go to minimalist solutions so joomla is has quite the oposite filosophy i usually folow, but hey, this is just my opportunity to prove myself there are other ways.

Ok, enough of cheap talk...

I went straight ahead to the docs (very good documentation i should say) but joomla appears to be quite complex and extense so I thought i should make a few questions to find out what docs to read and what approach to follow.

I gave a quick look at the documentation wiki and apparently there are a few different choices for extension development:
modules, plugins, components, maybe others...
From what i understood joomla has its own built in mvc framework that can be used to write modules... right? That can be the solution for me.

Now the questions....
I need to create a data type, basically a structure. Typically this would be an entity with it's own database table, etc.
Then i need to create a view to display a single row, a view to list the existent entries and backend with CRUD forms.
This should be a section of a site, to the rest of the site the regular out-of-the-box joomla publishing purpose will serve.
Whatever views (or ouput of any kind) I use should be able o be rendered smoothly with the rest of the site.


What's the best (possible) way to approach this?
Should i go for a module, plugin, component?
Will i need to add a table to the database or does joomla already has some way to create my own datatypes whith several fields?

Please try to illustrate your answers with links to the documentation if possible.

Thanks in advance

User avatar
Rogue4ngel
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 199
Joined: Sun Nov 26, 2006 10:46 pm
Location: New York

Re: New to joomla coding - need tips for extension development

Post by Rogue4ngel » Thu Feb 28, 2008 12:47 am

A good place to start if you want to really understand the structure of Joomla would be here:
http://api.joomla.org/

In these pages, you'll find very detailed information about Joomla's structure, and should give you some insight.

A module would probably be the best type of development to start with. A component is typically more of a stand alone application that runs in the joomla framework. Components may be a bit more difficult to start, but they give the user a powerful tool that can be used anywhere in a joomla template.

I was looking around for a book myself. We had spent a good deal of time prepping up from development work, and the project was side-tracked for a bit (company startup), but I'm slowly getting back into things.

I did find this, but I have no idea if it's any good
http://www.packtpub.com/Joomla-Extensions/book

Looked promising though. I may pick it up.
If you're not a part of the solution, you're a part of the problem.

plainas
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 27, 2008 12:53 pm

Re: New to joomla coding - need tips for extension development

Post by plainas » Thu Feb 28, 2008 6:37 pm

Thanks rogue4angel.
That was helpful.

I would like to go for a module as it looks quite simple, but I am not sure that will give all the power I need.

I need to create my own table database.
According on this documentation page
http://dev.joomla.org/component/option, ... ase_part1/
I can easily access the database within a module and create all the views i need.
I can access this class from a module, right?

Now, there comes some things i don't know about joomla ???

Taking the example used in the link i just posted. Let's say I wan't to store dogs in a database table, but I want them to be inserted only by the website owner.
I can make a module to display dog lists or details of a dog, that's apparently easy. I can also create a module with forms to insert/update/delete dogs, but since this would be only made by the website editor, it would make sense ( also not to confuse the editor ) to have it right next to the article management, in the admin panel.
Do modules allow me to add stuff to the admin panel?

It's possible that I am mixing some things up, I am not so familiar with joomla yet.

User avatar
Rogue4ngel
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 199
Joined: Sun Nov 26, 2006 10:46 pm
Location: New York

Re: New to joomla coding - need tips for extension development

Post by Rogue4ngel » Thu Feb 28, 2008 8:25 pm

I think you would have to use a combination of a component and a module.The module would be used for everything you mentioned, but I believe you would need a component to set up a custom menu item in the admin menu. And that would show up under the Component Menu. You can't actually change the admin menu structure.

I know there has been a recent request in features for a way to customize it, but that was only recently, so you can't change the menu itself, you can only add your component to the menu, which can then have a submenu.

This development for Joomla is still new for me as well, although I thought I'd be a bit farther along than I am, so I'm not sure how it will all actually work together.

I'm trying to set up my schedule so I can start working on a basic component in the next few weeks. I want to get on a regular schedule and just start knocking something out.
If you're not a part of the solution, you're a part of the problem.

plainas
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 27, 2008 12:53 pm

Re: New to joomla coding - need tips for extension development

Post by plainas » Thu Feb 28, 2008 9:36 pm

I've looked around the documentation wiki and i am getting more familiar with the available options.

There's a good walk through the new 1.5 MVC framework. From what I've seen its kind of using other frameworks out there. That's ok for me, I am confortable using php mvc frameworks.
I might go for the solution you pointed, maybe it will save me some time/work to use a component only to the admin part of the thing, and to the data presentation using a module.
On the other hand the application doesn't get wrapped in a package, but i don't think I'll reuse this code anyway... so, the module-component approach might be the best choice here.

Is this tutorial for joomla 1.5?
http://dev.joomla.org/component/option, ... llo_world/

Any suggestions, etc are still wellcome

User avatar
Rogue4ngel
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 199
Joined: Sun Nov 26, 2006 10:46 pm
Location: New York

Re: New to joomla coding - need tips for extension development

Post by Rogue4ngel » Thu Feb 28, 2008 9:45 pm

plainas wrote:
Is this tutorial for joomla 1.5?
http://dev.joomla.org/component/option, ... llo_world/
Yes, it sure is.
If you're not a part of the solution, you're a part of the problem.

plainas
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 27, 2008 12:53 pm

Re: New to joomla coding - need tips for extension development

Post by plainas » Sat Mar 01, 2008 12:55 am

Ops, dummy me, it said on the tittle that it was a document for joomla 1.5. Sorry.

I must confess that I am having more troubles using joomla as a site admin than getting into the code.

But first things first... I checked this documents:
http://dev.joomla.org/component/option, ... orld_mvc1/
http://dev.joomla.org/component/option, ... orld_mvc2/
http://dev.joomla.org/component/option, ... orld_mvc3/
http://dev.joomla.org/component/option, ... orld_mvc4/

In the fourth one it explains how to make a back-end but it does not tells anything about where that backend will actually end up.
Can anybody tell me where would that backend show up?

I have another basic usage question, i think it's no problem asking in this same topic.

I installed joomla without sample data, I created an editor. Where is the login form for editors?

Ok, one more:
I created and populated a menu, I published it too. Do I need to manually edit each template in order for the menu to show in it?


Post Reply