2022 Developer Survey is open! Take survey.
48 votes
Accepted

What is the proper way to make an AJAX call in component?

PLEASE NOTE THAT THIS ANSWER is already a few years old and was not updated. Feel free to edit / comment if you think something is no longer exact. Abstract There is almost no really official way ...
user avatar
26 votes
Accepted

Joomla 3.x extension development tutorial for a beginner developer

I will provide the list of my bookmarked links and a list with links for Joomla Development Books, with various resources all around Joomla Development. I hope they will be useful for anyone ...
user avatar
  • 19.5k
20 votes

What is the proper way to make an AJAX call in component?

This is a late answer for this very well answered question, but I wanted to add this cut-to-the-chase solution for those that just need a simple way to get to their components's data with an AJAX call....
user avatar
  • 7,665
20 votes
Accepted

How to save Custom Fields in Core components

The AHA! moment - #__content no longer has the params column, so the following adjustments have to be made for the plugin to work with components/tables with attribs instead of params (which appears ...
user avatar
  • 7,665
18 votes
Accepted

How can I use a model of other component in my component?

You can import com_content models into the controller using addIncludePath() method: JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); addIncludePath() ...
user avatar
  • 4,045
17 votes
Accepted

Adding drag-n-drop ordering in component

There are some prerequisites and you have to do some modifications to your view template. But you don't have to develop this feature all on your own. Prerequisites You need a column ordering of type ...
user avatar
  • 3,693
16 votes
Accepted

How to create page only with modules and no component?

There isn't really a 'better way' than that. The only other option is to check whether you're on the homepage in your template file. To check if you're on the homepage you can use the method ...
user avatar
15 votes
Accepted

Joomla Component Tool or Scaffold?

One tool that I've used in the past is Component Creator: http://www.component-creator.com/en/. This tool allows you to outline one table for free (more if you sign up for a paid package) as well as ...
user avatar
14 votes
Accepted

Custom Component - Need to verify if user is logged in

You can use Joomla's user object for this. $user = JFactory::getUser(); // Get the user object $app = JFactory::getApplication(); // Get the application if ($user->id != 0) { // you ...
user avatar
  • 26.4k
13 votes

Best method to check if a component is installed/enabled?

I use this way: // Check for component if (!JComponentHelper::getComponent('<component name>', true)->enabled) { ..... } <component name> - without "com_" prefix
user avatar
  • 7,415
13 votes

How to get the intro image of a joomla article

That code is looking in the article text you need to is in the images call. It is json encoded so you have to decoded it first. $images = json_decode($this->item->images); echo $images->...
user avatar
12 votes

Adding joomla's default toolbar in a component view page

The best practice is to create the addToolBar() method inside your View class and then using JToolBarHelper class to create command buttons: protected function addToolBar() { JToolBarHelper::addNew(...
user avatar
  • 4,045
12 votes
Accepted

Available fields in Joomla XML manifest

Numerous types of form field are built into Joomla, with many usefull fields like calendar, color picker, image picker, file upload, file selection etc.: Available Fields +---------------------+-------...
user avatar
  • 13.3k
11 votes

What is the proper way to make an AJAX call in component?

Valentin answer is good but is a bit overly complex if all you need to do is add 1 or 2 ajax calls to a component that is already built. It's perfectly possible to get away with not making separate ...
user avatar
  • 887
11 votes
Accepted

Add a custom button to a core backend component

Here is a draft idea using a plugin: You need to create a system plugin (I am not getting into that) and to use the event onBeforeRender. Inside you get an instance of your Toolbar and append the ...
user avatar
10 votes
Accepted

When will the JxxxLegacy classes be deprecated?

So technically you start transitioning to the new MVC classes now - there's nothing stopping you. For example com_config in Joomla core is already using the new MVC classes. However as you probably ...
user avatar
10 votes

How to modify article structure?

I believe I have your solution, but do NOT hack the core. We felt forced to do that over the years, and we're still paying the price even today, missing updates, revisiting hacks everytime we do ...
user avatar
  • 7,665
10 votes
Accepted

Best way to include helper class in sub-controller : require_once or JLoader

Actually JLoader::register('TestHelper','/path/to/test.php'); dosen't load file, it just registers it to be able to autoload file if class is instantiated. Do require it instantly, you want to use: ...
user avatar
  • 3,208
9 votes
Accepted

Structure folder of sql files in my component

As Milton already wrote you specify where those SQL files are in the install manifest file. There are three different locations for install, uninstall and update. <install> <sql> ...
user avatar
  • 5,527
9 votes
Accepted

How can I set the page title from a component

Ok, I've solved it. I removed the " " marks around $this->item->heading as follows: $browserbar= $this->item->heading; $document = JFactory::getDocument(); $document->setTitle($browserbar); ...
user avatar
  • 1,992
9 votes
Accepted

Multiple controllers in Joomla

I think you're confusing the purpose of your main / master controller (controller.php) and subcontrollers (everything in the /controllers folder). For more on this, see the docs. The main controller ...
user avatar
  • 2,295
8 votes

Joomla Component Tool or Scaffold?

After writing numerous extensions for clients, I found myself following a lot of the same patterns over and over. To keep things DRY, I created a "component framework" that abstracts away most of the ...
user avatar
  • 1,022
8 votes

Understanding mvc way of component coding for both joomla 2.5 and 3 version

There is a good doc page explaining the differences between Joomla 2.5 and 3.x. http://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_3_and_Joomla_Platform_12.2 The only thing to ...
user avatar
  • 5,527
8 votes

Joomla 3.x extension development tutorial for a beginner developer

I can recommend the official doc page. There is a section for developers which includes also tutorials. http://docs.joomla.org/Portal:Developers David Hurley is currently doing a series of short ...
user avatar
  • 5,527
8 votes

How to find a missing component - Error: 404 Component not found

You can find what is the missing component by either checking what is the component assigned to that specific menu item that creates this page, or if there is no menu item for this page you can ...
user avatar
  • 19.5k
8 votes

How to create a view with filters and pagination

Follow the below steps: Filters: 1) Make sure to add all your filterable fields in your model constructor public function __construct ($config = array()) { if (empty($config['filter_fields'])) ...
user avatar
  • 2,971
8 votes
Accepted

Click on custom button opens modal window

It's actually pretty simple. In view.html.php, load modal library, if it's not already done: JHtml::_('bootstrap.modal'); For adding button to toolbar, use: // Toolbar object $toolbar = JToolBar::...
user avatar
  • 3,208
7 votes

What is the proper way to make an AJAX call in component?

Valentin's answer is good. I prefer a json controller that handles the encoding and error handling for this I created a json base class: class itrControllerJson extends JControllerLegacy { /** @...
user avatar
7 votes
Accepted

Error when calling getItem method of external model

You may need to import the table classes also. Try calling JTable::addIncludePath(/path/to/other/component/tables); to bring them in.
user avatar
  • 1,590
7 votes

Joomla 3.x extension development tutorial for a beginner developer

Previous answers are comprehensive about Joomla Core MVC. As an alternative MVC for Joomla, FOF https://www.akeebabackup.com/documentation/fof/introducing-fof.html#what-is-fof https://github.com/...
user avatar
  • 7,415

Only top scored, non community-wiki answers of a minimum length are eligible