Español

Part of the strength of Joomla! it is the power of its components , but when we need a special functionality, the complexity in its development can delay programming times. Let's see how to solve it.

Develop a component for Joomla! starting from scratch can be tedious. There are too many elements that make it up: the administration part, the public site files, the controllers, the models, the views, the languages, the database integration scripts, forms ...

Joomla! means power and speed, we cannot stagnate. Let's see how to creatively save the need to implement a new functionality via component.


I have been working with Joomla! For more than 15 years. and I have learned different techniques to speed up my developments. I'm going to try to share my experience with you:

Remember that every URL in Joomla! you will necessarily need to load a component as the main part of the page, and this component will have to be linked to a menu item. The component always conditions the logic of the content of a page, that is why it is so important.

What do we do if we do not want to stay in a development forever, and we do not find a component that generates confidence, or solves our needs?

I propose 4 solutions:

  1. Replicate a component.
  2. Create a component with an external service .
  3. Simulate a component with a view.
  4. Work with modules .

We are going to see each of these options. Each of them has its advantages and disadvantages, but it is important to handle different alternatives to be able to program in a creative and fast way. It depends on the problem, we will find a solution.

1. Replicate a base component

Having a basic component that serves as a model, to be able to replicate it is one of the solutions.

If we have a base component already developed, with a little knowledge we can create views, forms, tables but starting from a base already defined.

I have developed a simple component that stores "leads", categorizes them, incorporates some basic fields, with administration and views in the public part. It also has a couple of empty views (one in the administrator and one in the site) that are very useful for fast custom development.

You can download it by clicking here . I have called it ASM Basic Component   I also leave it in GitHUb.

Method: copy & paste, later change file names, manifests, namespaces, views, etc ... until you have your component copy ready to host the new functionality.

I will not go into more detail, but be patient if you decide on this solution. 

2. Create a component with a SaaS service

The option of developing components with an external service is one of my favorites:

Sometimes the cheapest option ... is to pay!

Without a doubt, it is much faster than replicating a base model (the previous option), being able to incorporate in an extremely easy and fast way tables, elements, tabs, forms both the administrator part and the public part of the web.

This option is highly recommended when we need a tab style component, with a list, fields, filters ... and that can be used from the administrator and also used in the public part. Ideal for making intranets and to give the client the packaged and versioned component .

Be careful, I am not advertising, nor do they pay me anything to do this recommendation, but having a service such as Joomla Component Creator is essential in my day to day as a Joomla! Developer.

Let's remember again: we are here to do cool things without wasting a lot of time ... we develop with Joomla!

Method: register, create the component, download the installable and install.

3. A component of components

This is definitely one of my preferred solutions! ... use "empty" views of a component to introduce my own PHP programming into Joomla!

This option is very interesting when we need to quickly program with PHP something that needs to become the main part of a page (a form, a map, a carousel ...) and we do not want or need to develop a new component.

The quickest and easiest way to make a component is ... by not doing it.

Method:

  1. We install a base component with empty views, for example ASM Basic Component.
  2. We upload our * .php file to the folder / components / com_algosemueve / tmpl / blankviews / includes /
  3. We create a menu item with the "AlgoSeMueve" component and the "Blankviews" view.
  4. We select the file that we want to show in the layouts tab.

4. Work with modules and move on from the component

Finally, an option that is also very interesting and that we can use: develop the logic of a URL with modules instead of components.

We know that every page (Menu Item, URL ..) in Joomla! you always need a component for it to work. Let's use a "silly" component, with an empty view, that does not execute anything, and work with modules and that these take the leading role of logic.

Method:

  1. We install a base component with empty views, for example ASM Basic Component .
  2. We create a menu item with the "AlgoSeMueve" component and the "Blankviews" view.

I hope these 4 ideas can be of use to you in your Joomla! Developments.

All the best!

Ciro

This site uses third-party cookies to measure and improve your experience.
You decide whether to accept or reject them:
More info