7 votes
Accepted

Joomla Terminology: view, layout, task and component development

Running ahead a little bit let me provide you with link to JooYii Library. This library makes a leap ahead brings some practices that would be at Joomla! 4 to current Joomla! 3.x branch along with ...
user avatar
  • 1,120
6 votes

How can include the component view in plugins

From joomla 3.0 onwards a layout sharing feature is introduced, using it you can call a layout across views or extensions. It requires creating a layout object and then render the view using that ...
user avatar
  • 358
6 votes
Accepted

Extension manifest to set version as 3.4 or greater

You don't have to use only 2.5 or 3.0, you can also use 3.4 or any other Joomla version: <extension type="component" version="3.4" method="upgrade"> The version attribute specifies the minimum ...
user avatar
  • 3,693
5 votes

Standalone PHP calling Joomla APIs

Firstly, you're importing the wrong files which are required when using the Joomla API. You then also need to initialise the application. try the following: define('_JEXEC', 1); define('JPATH_BASE',...
user avatar
  • 26.5k
5 votes
Accepted

Joomla custom session data is overwritten

It looks like you're creating a new cart array instead of starting with your stored data. Try this: $session = JFactory::getSession(); $cart = $session->get('cart',array('items'=>array())); $...
user avatar
  • 585
5 votes

Remove /component/ from URL generated from module for a custom component

The /component/name/ part of the url is automatically written by Joomla router when there is no matching menu item found. This is required for the application to route the command to the proper ...
user avatar
  • 2,971
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 ...
user avatar
  • 3,134
5 votes
Accepted

How to generate a dynamic note field for a custom component?

Use Form::setFieldAttribute(). Typically, this is done in the model's getForm() method. However, if it's cosmetic only, it can be done in the view too. In /administrator/com_image/models/forms/image....
user avatar
  • 8,316
5 votes
Accepted

with insert on duplicate key update - updating multiple rows at once

Building a REPLACE INTO query is just as simple as building an INSERT ... ON DUPLICATE KEY UPDATE. Note that there is a difference between REPLACE INTO AND ON DUPLICATE KEY UPDATE. Code: $columns = ...
user avatar
  • 4,403
5 votes
Accepted

How to use HTMLHelper to add to the document head

1) JHtml is an alias for Joomla\CMS\HTML\HTMLHelper class. You'll have to start using the real class sooner or later because the alias will not exist in Joomla! 5.0. To use the real class you have to ...
user avatar
  • 8,316
5 votes

Content plugin doesn't add text to articles

Your plugin appears to be written for a very old version of Joomla! The event in current versions is onContentBeforeSave. You are also missing $context argument. It's a good idea to check for context ...
user avatar
  • 8,316
4 votes
Accepted

How to change styling of Joomla Collapsible Sidebar in Backend?

Well, as per my answer from the link you provided, you'll need to add the following to your default.php: <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> &...
user avatar
  • 26.5k
4 votes
Accepted

Can I add class attribute in JHTMLGrid?

First of all, this documentation is very old. Latest is here. You can't just add class to that. You would have to create your own JHtml* class and override it there. Following is just example, you ...
user avatar
  • 3,208
4 votes

Calling Joomla!'s Default 404 Page

In your Joomla installation directory reach templates/themeXXX/error.php file. Edit the error.php file as shown below, locate this line of code: If you don't want to change address bar url then you ...
user avatar
4 votes
Accepted

Joomla 3.9.1 publish/unpublish no longer working (custom components)

Inside your table's constructor use setColumnAlias() to define the actual column name: public function __construct($db) { parent::__construct('#__example', 'id', $db); $this->...
user avatar
  • 8,316
4 votes
Accepted

Select articles to display in custom component

JControllerLegacy::getInstance() caches the first controller instance so you're actually getting an instance of your component's controller rather than Content controller. You can skip the controller ...
user avatar
  • 8,316
3 votes
Accepted

Check a form field for duplicates before saving

The best place is your table class before storing data. For example below code in store function of table class. public function store ($updateNulls = false) { if ($table->load(array('alias' =&...
user avatar
  • 2,971
3 votes
Accepted

How to query and display a list of nested tags for a particular parent on front end as links?

To generate a list of tags you can take getTagTreeArray() method from JHelperTags class as a base and modify it for you needs - you can populate the resulting array not only with the IDs, but also ...
user avatar
  • 4,045
3 votes

How to set name for Administrator Menu Section of a Component?

The format you are using is normally associated with sub-menu's - I think the tutorial is incorrect/out of date — in our components the main administration menu item looks like this: <menu img=...
user avatar
  • 1,749
3 votes
Accepted

Joomla.submitbutton (...) stops working after 3.4.2 update

It turns out my problem was caused by the use of the onsubmit="" event at the form tag. NOTE: This is back-end code, I only have this problem when using the JToolBarHelper::buttons(); Here is what I ...
user avatar
  • 419
3 votes
Accepted

Importing Joomla CMS to custom PHP script (outside root folder)

This is because the JPATH_BASE value needs updating as you've moved the file into a new directory. So replace this: define('JPATH_BASE', realpath(dirname(__FILE__).'/')); with this: define('...
user avatar
  • 26.5k
3 votes
Accepted

Purpose of metadata.xml

So the purpose of metadata.xml is storing the data that need to be shared across layouts: each layout.xml inside of your view tmpl directory extends metadata.xml. So if you need to put some request ...
user avatar
  • 1,120
3 votes

Loading custom classes in a component automatically

If the utility classes are only used in your component then include them in a folder within your administrator component. Whether you register the classes with JLoader or just require_once them just ...
user avatar
  • 3,134
3 votes
Accepted

Bulk insert records in database from excel

I solved the issue. Problem was that when insert query was called in a loop 2000 times, deadlock occurred and returned a blank page. The solution to this is to construct one single insert query and ...
user avatar
  • 1,365
3 votes
Accepted

Subform multiple data not saving

In your table's bind function, add this: if ( ( !empty( $array[ 'list_links_url' ] ) && ( is_array( $array[ 'list_links_url' ] ) ) ) ) { $this->_jsonEncode[] = "list_links_url";...
user avatar
3 votes
Accepted

Redirect after login by component

You can create a plugin that triggers on onUserAfterLogin and redirects the user to where you want. or you can add a &return= query variable to your links to the login page as described here
user avatar
  • 890
3 votes

Set Prefered Template with parent:display()?

You can force the template style like this: $templateStyleId = 3; // set here the template style id $app = JFactory::getApplication(); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/...
user avatar
3 votes

Create SEF URLs from a Custom Component that does not search on database

One thing is, that you're trying to create a router in the old way, it changed over time. Now router is a class. Second thing is, one of your component views have to be set as a front-page for a ...
user avatar
3 votes

Proper Way to Migrate Custom Website to Joomla

You can certainly add CSS or JavaScript by creating a plugin or module but the quickest and easiest way to do this is probably using a third party extension such as the EasyScript plugin or the Flexi ...
user avatar
3 votes
Accepted

onUserAfterLogin popup - Joomla 3.6.4 Plugin

The return value of onUserAfterLogin() should be a boolean -- ie true or false. The idea is that you can use this event handler to do additional validation on the login, so if you return false, it ...
user avatar
  • 610

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