4

When developing, error reporting should be enabled. You'll see this: Notice: Undefined property: Joomla\CMS\Table\Content::$item Access the images like this: $images = $article->images;


3

To show profiling information in Joomla, enable Debug System option in Global Configuration, enable System - Debug plugin and enable Show Profiling option in plugin's configuration.


3

Assuming you have a database table setup for this, you can use the following code to perform you check: // This function is taken from my own extension public function getIpAddress() { $server = $this->app->input->server; $clientIp = $server->get('HTTP_CLIENT_IP'); $httpFwd = $server->get('HTTP_X_FORWARDED_FOR'); if (!...


3

I'll answer this myself too as I have a lot of experience with lazy loading assets. preload may seem like it asynchronously loads files but it doesn't. They're still considered render blocking. This also applies if you also just add your assets to below the closing </body> tag as there's still remaining HTML to be rendered. You're best approach will ...


3

If I understand the usage of preload correctly, in 3.x you can add these links manually with addHeadlink(): // Preload resources $mediaVersion = $this->mediaVersion ? '?' . $this->mediaVersion : ''; $this->addHeadLink($this->baseurl . '/templates/' . $this->template . '/css/template.css' . $mediaVersion, 'preload', 'rel', array('as' => '...


3

Use string filter instead of the default cmd filter: JFactory::getApplication()->input->get('myParam', '', 'string') Or: JFactory::getApplication()->input->getString('myParam')


3

JROOT is not a valid path constant. Change it to JPATH_ROOT. Or use JPATH_ADMINISTRATOR instead of JROOT . DS . 'administrator'


2

Perhaps your module has an override in the template used by the website. You can verify this in the template configuration page of the back-office. If that's the case, just delete the /templates/[template name]/html/[mod_your_template] folder, and Joomla will use your original module files.


1

I agree that your "Solution 2" is better because it implements a more readable syntax. I might be a little too nitpicky because I have been spending time volunteering at CodeReview, but perhaps you could clarify your variable naming. Your abbreviated naming is probably very clear to you, but it will make your code more readable for other developers if you ...


1

You can just add the necessary db query to add this, see: https://docs.joomla.org/Inserting,_Updating_and_Removing_data_using_JDatabase However, you might be able to instantiate the RedirectModelLink model (/administrator/components/com_redirect/models/link.php) and use that to add / delete data.


1

I went down this rabbit hole several years ago as a self-educating endeavor. You can go to the extent of leveraging a blend of server-side and client-side to sniff/frisk/detect a device. The truth is that all data that you might wish to process: can be spoofed/circumvented can naturally fluctuate/vary enough to trip up your algorithm can be missing ...


1

Just to clear a few things: I don't think there is anything that can tell this, not only in Joomla but in anything in the web. Under certain conditions you may be able to tell if a certain browser was at your site recently, e.g. like what G. Analytics does when counting new vs old visitors, which is a cookie based solution. But there is no real accuracy on ...


1

There is JHtmlNumber class but it only has a method for converting bytes. Because Joomla! does not use INTL extension, formatting there is done using simple number_format() with language strings (THOUSANDS_SEPARATOR and DECIMALS_SEPARATOR) acting as separators. So formatting would depend on user's language.


1

I understand from your question, that want to run a scheduled task on your Joomla component, but you don't want to use a cron job by the operating system, because the user of your component would have to set it up. Unfortunately it is no possible to start scheduled tasks from within Joomla, because Joomla is not running all the time. The server just ...


1

The component is used to create content for a page. The linking within Joomla is between components and only links to component views can be added to the menu. Modules are used to place additional content on pages of a web site, along the main content created by the component. Ususally this is done by side, top or bottom bars, while the main content is in ...


1

I knew a joomla doc page on it, but i can't find it now. Here is what i remember from that page. Assume joomla as an OS like windows. Module is the most limited one functionally cause you have to assign it to somewhere on the Components view, so it's like widgets of the OS. Plugin is like the background services of this OS, which are running on every ...


1

Using regular expressions to manipulate valid HTML is not advisable because regex is "DOM-unaware" meaning that it doesn't know if it is actually modifying a tag or just text that seems like a tag. Also, unless expressly told to replace only once, it will happily modify multiple matching strings (effectively damaging your content). Finally, using ...


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