Questions tagged [joomla-4.x]
For questions regarding version 4.x of the Joomla! Content Management System.
31
questions
3
votes
1
answer
154
views
How to create an instance of the Joomla CMS from the browser or the command line
Recently there have been a number of questions posted on JSE relating to how to load the Framework that in most cases is really asking how to load up the Joomla CMS either from a command line or via a ...
1
vote
1
answer
1k
views
Joomla 4 - how to set namespace for custom field addfieldprefix
I have the editors-xtd\vimeo plugin with this structure
..\plugins\editors-xtd\vimeo\models\fields\(a bunch of custom fields)
..\plugins\editors-xtd\vimeo\forms\form.xml
..\plugins\editors-xtd\vimeo\...
3
votes
2
answers
1k
views
Joomla 4 create article programmatically
I have tried a few ways to create articles programmatically in Joomla 4, but none of my attempts are working.
First is to insert data by mysql using $db->getQuery(true) -- the article shows in the ...
1
vote
1
answer
199
views
Change the default articles list ordering overriding the model
I need to change the default ordering of the articles list in the administrator Articles page. To do this I probably would have to edit the populateState() method in administrator/components/...
1
vote
1
answer
1k
views
Get Framework and template params in Joomla 4
Joomla 4 is coming soon and i need to know how to get the joomla framework and template params in php files outside of joomla.
This is the way in J3:
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 )...
8
votes
1
answer
175
views
Joomla extension update 3.x and 4.x
I have an update server for my extensions, which targets Joomla 3.8 and 3.9
<targetplatform name="joomla" version="3.[89]"/>
With the release of Joomla 3.10 and 4.0 coming ...
5
votes
4
answers
5k
views
JFactory::getDbo() deprecated-- what's the replacement?
I'm running Joomla 3.9.5 and I'm attempting to update my JFactory::getDbo() calls (which are deprecated) to the newer format using the container. However, I'm getting the following error: Call to ...
4
votes
1
answer
998
views
Replacing JSubmenuHelper with JHtmlSidebar / Administrative menu in Joomla 4
I've been racking my brain how to add links to all the views of my component in the shiny new Joomla4 backend; I used to do it via JSubmenuHelper, but that, apparently being deprecated also before, ...
4
votes
2
answers
470
views
Is Joomla4 API/Web Service ready for production use?
I've read what little I can find about J4 Web Services, but cannot find a working example or get my code to work. The code below should work by all accounts, but I get forbidden on my local machine ...
3
votes
1
answer
1k
views
Joomla4 plugin getBody
In Joomla 3.x versions I use JResponse to get and set the body.
function onAfterRender() {
$content = JResponse::getBody();
...
}
But in Joomla4 it returns Class 'JResponse' ...
3
votes
1
answer
936
views
Class not found in Joomla 4 when using JDate inside a function
In my last question I tried to modify mod_latest_articles module, and added myCustomFunction to ArticlesLatestHelper.php like this :
/**
* @package Joomla.Site
* @subpackage ...
3
votes
1
answer
2k
views
How to use HTMLHelper to add to the document head
In this post: How to add CSS/JS/an Image to a module backend @lodder shows me how to use HTMLHelper to add CSS and JavaScript.
Previously I had followed the Joomla! documentation https://docs.joomla....
2
votes
1
answer
428
views
Fatal Error: Class 'ArticlesLatestHelper' not found in Joomla 4 module while trying to add new function
I'm testing and playing with Joomla 4 alpha.
What I tried to do is to quick-edit / modify the module Latest Article (mod_articles_latest), adding a new function.
In joomla 3.x I usually adding a new ...
2
votes
1
answer
93
views
Joomla MEMORY tables cause an error in creating/editing articles
I am encountering an error with Joomla 4 that has never occurred to me in previous installations. When I try to create/edit an article, a category or to index contents in smart search, I get the ...
2
votes
1
answer
2k
views
Get the Article ID in J4.0
I am trying Joomla 4.
My biggest problem is to migrate the get article id functionality.
In Joomla 3.x, I used:
defined('_JEXEC') or die;
$id= JRequest::getInt('id');
but this is not longer ...
2
votes
2
answers
799
views
Joomla 4 - Invalid controller class:display
I'm building a simple component in Joomla 4, and after reading through some tutorials I feel like I've got it right - but I'm getting this error that I can't explain in the admin view
An error has ...
1
vote
1
answer
353
views
Remove component's view name from url joomla 4
I am using Joomla 4.2.1. I installed custom component which is previously used into Joomla 3.10.11.
I create a menu item with view from this component.
On Joomla 3.10.11 it works fine
for example : ...
1
vote
1
answer
212
views
How to set a root article as subpath url for children articles
How to set a root article as sub-path URL for children articles?
Meaning, I have a root page named article0, and article{1-100} under this root article.
I want to display the article0 under the URL ...
1
vote
1
answer
156
views
About Joomla 4 Lazy Loading feature
everyone.
I've read this: https://magazine.joomla.org/all-issues/january-2021/using-native-lazyloading-on-your-website, so it's clear to me that media images inserted in articles content will be lazy-...
1
vote
1
answer
582
views
Connecting to an external database in Joomla 4
Connecting to an external database in Joomla 3 is easy following this documentation and works like a charm. But JDatabaseDriver->getInstance method is deprecated in Joomla 4. What is the ...
1
vote
1
answer
59
views
What is the best way to have pages displaying articles from our custom content table in Joomla 4.1?
Related: Is it possible to make it so that authors can edit their own published articles creating a new unpublished version of them?
The answer to that question is "In Joomla 4 it is, but authors ...
1
vote
2
answers
3k
views
JRequest Method in Joomla 4
JRequest Remove from Joomla 4 then how i must use this method
for example
$controller->execute( JRequest::getCmd('task', $view)
not work
i must change it to what ?
1
vote
1
answer
99
views
Is it possible to remove the "new article" button from all sections in a Joomla website?
A mate and I are doing an internship at university, and the project we are working on is a small Joomla 4.1 website. Our supervisors asked us to override the mechanics of content insertion so that an ...
1
vote
1
answer
1k
views
Joomla4: Load a custom stylesheet (admin.css.php) in administration
I want my custom modules & custom template to fetch the parameter values (colors) from my custom template's backend. This way I can see what colors I'm picking when when I'm configuring my website....
1
vote
1
answer
1k
views
Attempt to assign property "team" on bool
I am trying to create a model in Joomla that will display various information pertaining to a certain ID. When I create the function:
public function getItem ($id = null)
{
if ($this->_item ===...
0
votes
1
answer
88
views
Is it possible to make it so that authors can edit their own published articles creating a new unpublished version of them?
Related: Is it possible to remove the "new article" button from all sections in a Joomla website?
Worflows in Joomla 4 are great, but there is a feature I'm not sure they have: letting ...
0
votes
1
answer
74
views
pass on value of id in another variable
I want to pass value of id in new variable v_id so that if we are displaying news in frontend value of v_id can be shown in front end
Essentially the role which id do, can be performed by v_id
Pls ...
0
votes
1
answer
89
views
getMailer gives "Failed to start application" exception after updating to Joomla4, how do I fix it?
The issue
Quoting (again) from an old question of mine:
I have a form in my Joomla! site. Once completed, the form should send an e-mail but only if some conditions have been met.
Not having been ...
0
votes
2
answers
71
views
Retrieving text from a sub-form checkboxes field [joomla 4]
I get the value checkboxes:[film_rea], but I can't get the corresponding text [realisation].
<?php foreach ($this->item->jcfields as $field) {
if ('films-pros' === $field->name &&...
0
votes
0
answers
180
views
Access namespaced custom field method from a plugin into another plugin
In one of my previous questions, I learned how to properly set up a namespaced custom form field, but it turns out that it's only available within its plugin scope for some reason.
I need the field ...
0
votes
1
answer
109
views
MySQL "LOAD DATA LOCAL INFILE" with database connection object in Joomla 4
In order to import large CSV files into a Joomla database table, I use the MySQL "LOAD DATA LOCAL INFILE" command as follows:
$db = $this->getDbo();
$sql = "LOAD DATA LOCAL INFILE '&...