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 ...
fruppel's user avatar
  • 3,723
6 votes
Accepted

Programmatically Add Menu Item in Component

firstly - menu items are not put into the assets table, so this question is about a non-existent problem. The link provided in the question gives the correct answer for joom 2.5 and 3.x. but for ...
jamesgarrett's user avatar
  • 3,289
6 votes
Accepted

JLayout recommended usage

You can used Joomla's renderModal function to initiate a Bootstrap modal. $name = 'myModal'; $html = '<a href="#modal-' . $name.'" data-toggle="modal" class="btn">Launch modal</a>'; $...
Lodder's user avatar
  • 26.8k
5 votes

How to set get('Items') limit?

Like others have said - put this in the model's populateState function $this->setState('list.limit', $limit); #limit=0 removes limit $this->setState('list.start', $start); But you must make ...
mhorne's user avatar
  • 151
5 votes
Accepted

How to add a composer package without modifying the core composer.json file

I suspect that modifying Joomla's root composer.json file will come with Joomla 4. In the meantime, I think the best way to use composer packages is to include a composer.phar in a custom system ...
jamesgarrett's user avatar
  • 3,289
5 votes

How to reverse-engineer a 3rd party Joomla extension to clone it and to be able to make modifications to it?

Normally a template should deal with the layout and the presentational elements. Having said that, I have to say that I haven't seen any template (including quickstart packages) coming with ...
FFrewin's user avatar
  • 19.6k
5 votes
Accepted

Using external library with a component

If you're only ever using a library within a single component then there's no reason not to include it in a folder in the component - this is the way that distributed components will generally handle ...
jamesgarrett's user avatar
  • 3,289
5 votes

Component Development PHP Version Check

Lots of components have a check like that. Here's the top of admin tools core install script eg. protected $minimumPHPVersion = '5.3.3'; public function preflight($type, $parent) { // ...
jamesgarrett's user avatar
  • 3,289
5 votes
Accepted

How is the relationship between template styles and menus stored in Joomla 3.x?

template_style_id column in #__menu table.
Sharky's user avatar
  • 10.8k
5 votes
Accepted

Why is my plugin not hooking into events?

Plugin class name must match the plugin name defined in manifest file. If you have this in the manifest: <filename plugin="installer_log">installer_log.php</filename> Then class name ...
Sharky's user avatar
  • 10.8k
4 votes

Date/time picker in component

The only downside to @johanpw's solution is by using #datetimepicker2 that means this field type can only be used once. Good solution otherwise! Instead try the following in your /modules/...
VaciDesign's user avatar
4 votes

Available fields in Joomla XML manifest

There is also one other neat trick - when using Radio buttons, you can add Bootstrap class and they will look nicer. Look for class attribute in this code: <field name="some-choices" type="radio" ...
Vladimir Jovanović's user avatar
4 votes
Accepted

CLI command line script working locally but not on host

Have you checked that php5-cli is installed? If it's not installed, you can run the following in command line to install it: apt-get install php5-cli or yum install php5-cli
jdog's user avatar
  • 953
4 votes

The safety of direct SQL-requests in Joomla templates/views

Joomla is built on the MVC design pattern, so querying the db from a view is bad practice. But with your scenario, let's consider a few alteratives: changing the model: this makes no sense: you can't ...
Riccardo Zorn's user avatar
4 votes

Question/Advice about PHP code development in Joomla!

*First of all, it is generally a bad idea not to use HTTPS when dealing with sensitive data. Also storing the data itself in the database without any encryption may later lead to a leak. You should be ...
Valentin Despa's user avatar
4 votes
Accepted

How to automatically create the installation zip archive of a Joomla extension?

You can try a (free) component called JDeveloper. It's mainly for extension development, but it also has a function to create and download a zip-file from any existing Joomla extension. Just install ...
johanpw's user avatar
  • 13.3k
4 votes
Accepted

Get Title from ID

You could try something like the following: public function onYOURFUNCTION($context, &$article, &$params) { $id = JFactory::getApplication()->input->getInt('id'); $load = $...
Lodder's user avatar
  • 26.8k
4 votes

How to use Github as an auto-update deployment server for Joomla 3.x extension

Have a look at the Weblinks repo It does exactly what you want to do. The updateserver points to the manifest hosted on that repo. Download packages are served from the repo as well. Of course you ...
Bakual's user avatar
  • 5,557
4 votes
Accepted

Errors de-crypting libsodium encrypted values from database

This works fine with a simple encrypt then decrypt, like... ...but when I write to a database and read back, I get the errors mentioned above. This is actually expected behavior, because the ...
Scott Arciszewski's user avatar
4 votes
Accepted

How to write a query with GROUP BY and ORDER BY using Joomla's query methods?

I see minor typos in each of your coding attempts (misspelled method names: selcet and loadObjectLsit). Write the GROUP BY order like so: (Reference Link) SELECT id, DATE_FORMAT(estEventDate, '%b %Y'...
mickmackusa's user avatar
  • 4,781
4 votes
Accepted

What is the different between JPlugin and \Joomla\CMS\Plugin\CMSPlugin

JPlugin is an alias of Joomla\CMS\Plugin\CMSPlugin. It is the same thing at the moment, but one should start using fully qualified class names because all aliases in Joomla! are deprecated and will be ...
Sharky's user avatar
  • 10.8k
4 votes

Coding Standard Question - defined( or \defined(

I asked this on the Joomla! internal development chat and was told the second one is the optimised version currently in namespaced files. Richard, a lead Joomla! developer wrote "Backslash makes ...
mfleeson's user avatar
  • 128
4 votes
Accepted

How to remove a file from a template using the installer?

You have to create an installer script. The provided generic installer, Joomla\CMS\Installer\InstallerScript, has some functionality for removing files and folders so you could extend it. Create a ...
Sharky's user avatar
  • 10.8k
4 votes

How to create a (better) development environment for Joomla 4

I've not used Docker so I can't help with that, but I have xdebug set up on my local environment in combination with PHPStorm and that is a big help in enabling me to figure out why something's not ...
Grant Hood's user avatar
3 votes
Accepted

State set to 0 after parent::publish

You are calling parent::publish(). This method has an array which maps tasks to states (line 190): $data = array('publish' => 1, 'unpublish' => 0, 'archive' => 2, 'trash' => -2, 'report' =...
fruppel's user avatar
  • 3,723
3 votes

Apply the same code on PHP to content of component and each module

There are a variety of ways on how to modify Joomla content with a plugin: A component may call the plugin mechanism, for example com_content uses the "onContentPrepare" event. You can use this to ...
jdog's user avatar
  • 953
3 votes

What does $context parameter of content plugin mean?

The $context parameter can be used to define if your plugin should run or not under certain circumstances. For example, you might want your plugin to run when displaying category blogs, but not when ...
johanpw's user avatar
  • 13.3k
3 votes

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

You can access a controller directly by using the controller name in the task: index.php?option=com_similar&task=controller.abc&format=raw will call: controller.raw.php (return is raw) ...
Dennis Heiden's user avatar
3 votes
Accepted

Joomla Component Development: Starting Point

Legacy MVC will be supported until EOL of Joomla 3 (at least). I would just go ahead and use that. You will find many tutorials for legacy MVC and you will probably get the most help for that here or ...
fruppel's user avatar
  • 3,723
3 votes

Question/Advice about PHP code development in Joomla!

An extension like "Chronoforms" helps a lot. You can create forms and questionnaires, connect to the database, work with PayPal, divide the whole form into pages and send e-mails!
user7621's user avatar

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