Artur Stępień
  • Member for 7 years, 1 month
  • Last seen more than a month ago
How can I get the names of the columns in an object or table with Joomla's SQL?
Accepted answer
8 votes

Your foreach will result in situation where $key is array key and $value is one row from database. If you want to get column names from result just use get_object_vars: $db = JFactory::getDbo(); $...

View answer
Language switcher doesn't show all languages
3 votes

To create a multi-language website you need to: install and enable other languages enable language plug-in assign default menu item for each language create content languages for each language Make ...

View answer
How to change form values sent by a module?
3 votes

If you're talking about module definition file that holds module options you can't do much in the file using framework it-self. But you can do it in 3 other ways. In the UI by Java Script Just create ...

View answer
Create SEF URLs from a Custom Component that does not search on database
3 votes

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 ...

View answer
Why does Joomla have both models and tables?
Accepted answer
3 votes

Class JTable is created to work strictly on database object. Table object should create,modify,delete,check data in database. It can be used in many models, helpers, modules. Single model some times ...

View answer
Multiple INSERTS in one query Joomla
Accepted answer
3 votes

Use JDatabaseDriver::splitSql($query) so your function will look like this: $query = "INSERT INTO `table` (`fied1`, `field2`, `field3`) VALUES ('one', 'two', 'three'),('four', 'five', 'six'); ...

View answer
Using AJAX in a custom module - how to do it?
2 votes

I don't understand why you are trying to bypass the framework. I know it is resources wise but it opens you up to security risks. The other thing is that you can't use framework classes/functions as ...

View answer
Empty error message when saving article
2 votes

On the Server tab of global configuration set Error reporting to Development and enable Debug System in System tab. That should give you a more descriptive error message as well as a back trace.

View answer
Joomla 3.6 Template Creation - Article Titles and Bodies
2 votes

You need to override Joomla! template. Here are some details about overriding Joomla! template: https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core You can also check basics about ...

View answer
How to use JHtml::booleanlist with btn-group
2 votes

It would be better to just load a JFormFieldRadio it will take care of required scripts. JFormHelper::loadFieldClass('radio'); $field = new JFormFieldRadio(); $field->setup(new SimpleXMLElement('&...

View answer
How to read resp. parse Joomla session data read from database?
Accepted answer
2 votes

In that field data is split into namespaces. Namespace and its data is separated by |, so if you use explode('|',$data) you will achieve array where odd index element is an data array and each even ...

View answer
How to get the link of a category for item
2 votes

Use ContentHelperRoute to get article category url. It can be one like this this article view: JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)) If you need this out of ...

View answer
Custom fields in com_content does not display when editing article in front end
Accepted answer
2 votes

In front article edit form there are only selected fields added. If you want to add something there you will have to use Template Overrides to edit this file: /components/com_content/views/form/tmpl/...

View answer
Translated module is always en-GB
2 votes

I'm not sure but your module definition/installation file should look more like this: <extension type="module" version="3.1.0" client="site" method="upgrade"> <name>mod_mymodname</...

View answer
How to get currently opened article vote / rating value
Accepted answer
2 votes

Please avoid pushing pure queries. Do it like this: $db = JFactory::getDBO(); $query = $db->getQuery(true); $query-> select('rating_sum')-> from('#__content_rating')-> where('...

View answer
Joomla 3 onContentAfterSave not work backend
2 votes

Check following things: Plugin class name should be: plgContentTest Plugin class should extend JPlugin class Plugin filename should be: test.php Plugin file should be in: /plugins/content/test Plugin ...

View answer
Cookie Law and Folcomedia - Cookies Alert
2 votes

You should not load jQuery from google for a simple reason. There is almost 90% chance it will be loaded from system (so better require it from system like this: JHTML::_('jquery.framework')) so you ...

View answer
Changing user group in onUserBeforeSave of user profile plugin doesn't work
Accepted answer
2 votes

You can't edit user data in onUserBeforeSave and onUserAfterSave event. This is just a copy of what will/was saved. It would be better to: use onUserAfterSave event get user object after save $user = ...

View answer
How to get user group id by group name?
2 votes

Please avoid framework changes. This will lead you to system/functionality break after update. Create a User type plugin and work in it on event called onUserAfterSave.That way you will be update-safe....

View answer
How to match database values regardless of accents on letters?
1 votes

Method 1 - Store additional column First method is to store additional column in your artists table with only a latin characters in it (eg. beyonce). Method 2 - Update the LIKE query MySQL have the ...

View answer
Unable to update NULL via updateObject
1 votes

The way it should be done For now (until they introduce full entities support somewhere in Joomla! 4.x) it is better to use JTable to store "entities". In that way you can simply set $...

View answer
Example of DI Container usage in Jooma 3.x
1 votes

I saw it in the code but not outside of framework (in any of the extensions). I believe it gonna be used on a bigger scale in Joomla! 4. The main benefit from that is testability but there are others ...

View answer
Selected value without submit button
1 votes

Bind into onChange event on your select. In that event create Ajax request using com_ajax. In your module helper create a method that will handle the request and return output to com_ajax. The ...

View answer
Get ajax post data from another module in plugin
1 votes

Direct request into plugin method using com_ajax (https://docs.joomla.org/Using_Joomla_Ajax_Interface), that keeps your flow inside framework as well gives you a bit more security.

View answer
Update all image paths from http to https in Joomla 1.5
1 votes

The simplest solution is to make an SQL query replacing src="http://yourwebsitedomain to src="https://yourwebsitedomain of course database backup is required.

View answer
Abandonware user self-registration procedure in Joomla core
1 votes

It looks like leftovers from rebuilding the registration process. If you look closer it doesn't return in the code a proper message that depends on the activation method (admin, self, auto). And by ...

View answer
How can I create a custom attribute/property on a model?
1 votes

Table You can modify a Table object (usualy in /administrator/com_yourcomponent/tables/property.php) of this Property to set the is_sold property in load method right after parent::load(). Model Other ...

View answer
Load a custom css file from a component into the head tag after the backend template css file
1 votes

If you want to add a a custom html into component configuration popup you would have to create your own field type. That way you can manage the layout but still keep your component inside a framework ...

View answer
Frontend part of component development question?
Accepted answer
1 votes

You should: Create model Tracks in models folder in your component containing a class YOURCOMPONENTModelYOURVIEW for example TracksViewItems. In this class add a public function called getItems(). Add ...

View answer
Decorate Menu Option
1 votes

Instead of looking into JMenu class you should look into mod_menu and overriding its layout or a proper Java Script code cause this is a presentation (template) feature, not data. Just later menu item ...

View answer