You can use JSON format in the controller directly by adding .json suffix and changing format in your URL to json. In this case the controller would be placed in /administrator/components/com_example/controllers/ajax.json.php. It's contents:
defined('_JEXEC') or die;
class ExampleControllerAjax ...
This component is developed using Akeeba FOF, so you need to read the documentation to know how to complete the task.
Almost everything is configured using XML, this is to some extent of course.
Have you done already these basic checks?
1 - Enable Joomla Caching
This will already significantly boost your page loading times
Go to your plugins and open Page Cache plugin
Usually it shall be already configured like this:
Save and close it
2 - Configure your Cache TTL and behaviour
Go to System - Global Configuration - System(-tab)
Enable the ...
Recent Joomla version can handle the errors based on native PHP exceptions, so just throw an exception with corresponding message and value, Joomla will display the error page set (template, custom…)
throw new Exception(JText::_('JERROR_LAYOUT_PAGE_NOT_FOUND'), 404);
Source: Whats the correct way for exception handling?
You can use the robots.txt file to disallow the indexing. Try using this directive in your robots.txt file.
The cons of this approach is that not all search engines crawlers observe the wildcard syntax. I think this will do the trick with the major ones (Google, Bing and Yahoo).
I found this and this ...
I had the same problem on twitter. I was trying to add my link picture just as facebook does automatically but had to investigate the CARD Validator here https://cards-dev.twitter.com/validator ...Tthe way I have it working on Joomla 3.9.11 is adding this code in the head of my template default.php ... I was able to properly add the title, the description ...
There is the install script there for this task in Joomla which can fire on different points of the extension install or uninstall processes, like install, uninstall, preflight, postflight and on update. You can use that script with your extension (plugin, component or module). You can run any kind of functions at the different events.
You have to study the ...
Create a installer script for your component (com_your_component_name/script.php) and add the following code:
defined('_JEXEC') or die;
The installer script file allows you to run code when your component is installed, uninstalled, ...
For the purpose you are describing, your best bet is to create your own Joomla custom library. It's a type of Joomla extension alongside with plugins, modules and components, allowing you to put your custom common code. There is not much examples in Joomla documentation but Roberto Segura (phproberto) made an awesome example of a custom library available on ...
In your index.php, you can use the following:
<?php $menu = JFactory::getApplication()->getMenu(); ?>
<?php if ($menu->getActive() != $menu->getDefault()) : ?>
<jdoc:include type="component" />
<?php endif; ?>
All this basically does is check if the active menu item doesn't match the default menu item. If it doesn't, ...
Website visitors can be directed to a maintenance page at index.html or index.htm rather than any kickstart.php or index.php file as most hosts are configured to load index.html or index.htm in preference to index.php.
You can ensure this is the case by adding the following directive to your .htaccess file:
DirectoryIndex index.html index.htm index.php
I figured it out.
Instead of using the JTable class, I import the model gameModel as described here.
The by deleting the item via the model, the tag-associations are removed as well.
This is the code change:
public function delete(&$pks)
I'm a little confused by created therefore a simple PHP project so I'll assuming by this you're referring to your component.
Basically, all Joomla clases (Jxxx) are autoloaded (I think with exception of a couple such as JFolder, JFile, and a few others), so you can just access them directly without having to import them:
$user = JFactory::getUser();
To answer the question about what is core and what isn't when you look at the extensions under the Extensions->Manage->Manage menu look at the ID column on the far right and if the ID is less than 999(or only has three digits) then it is core, if it above 10000 then it is 3rd party.
If the site has been progressively migrated from early versions of Joomla ...
Any layout or view can be overridden in Joomla.
You can do this in your Joomla admin panel, by going to:
Extensions (top menu) >> Templates >> Templates >> Details and Files
Once there, go to the "Create Overrides" tab, and you will be able to select your component annd the view.
So let's say you create an override for com_content/archive. This will ...
The problem was solved by adding the JHtml::_('behavior.framework'); directive in the view so that the problem of:
ReferenceError: Joomla is not defined
that occurred when you clicked on any of the pages of the pager component
The final code is
defined('_JEXEC') or die('Restricted access');
class DemoViewDemo extends JViewLegacy
Looking at how Weblinks works I can see that the only time weblinks.go gets involved is when you have have an option selected to count Hits for each link causing view.html.php to display this style of link:
$item->link = JRoute::_('index.php?option=com_weblinks&task=weblink.go&id=' . $item->id);
at line 88 of default_items.php
I would ...
From your question it is ambiguous whether your entry file is inside the admin subfolder or not. It should be in the com_administratie folder if it isn't. Also your xml files declaration looks odd:
The folder attribute should just be site ...
Use file manifest to install files not belonging to any extension:
<?xml version="1.0" encoding="UTF-8"?>
<extension version="3.9" type="file" method="upgrade">
The comment from @mickmackusa is essentially correct, but there's some context missing, perhaps, from your question that makes me wonder if you're not asking a wider question. There are wide variety of reasons for the overrides you're seeing.
In an MVC world "save" is both a controller and a model method. It stems from the concept "separation of concerns." ...
Looks like the variable $params isn't getting set.
Could be several reasons this is happening, among them that there isn't a menu item set in the current URL.
As @lodder noted, this is old code. The mechanism involving the static call of getMenu from the site application was deprecated years ago; nobody should be using it anymore. (Don't remember precisely ...