Questions tagged [joomla-4.x]
For questions regarding version 4.x of the Joomla! Content Management System.
426
questions
0
votes
1
answer
18
views
How to use Joomla.listItemTask in Custom Component
Hi i need an example on how to implement a simple on / off toggler in a Joomla 4/5 Custom Component's list view.
I've tried the following code but i did not get any reaction in the model / idk how to ...
0
votes
1
answer
32
views
Getting a Joomla 4 API component to work with language files
When programming a component for an API, the config contains the following language file definitions:
<api>
<files folder="api">
<folder>src</folder>
&...
0
votes
1
answer
19
views
New Way to use Toolbar::getInstance('toolbar')
So there is this deprecated message that pops up when using:
$toolbar = Toolbar::getInstance('toolbar');
Message:
4.0 will be removed in 6.0 Use the ToolbarFactoryInterface instead
Example: Factory::...
0
votes
1
answer
27
views
Joomla 4: How to add a main menu item to the article?
I've encountered a problem and I can't seem to solve it.
My articles are tied to subcategories.
In one menu item, I display a list of all articles. Let's call it [all-articles]. This is Blog layout.
...
0
votes
0
answers
20
views
Route not working properly on J4?
I have a menu entry like so:
ID: 524
Type: Articles->Create Article
Link: index.php?option=com_content&view=form&layout=edit
In the "old days" I'do Route::_('index.php?option=...
0
votes
0
answers
10
views
How to delete root user group?
I transferred all my users from J3! to J4! using JLex Transfer. In my J3! site I had incorrectly created usergroups as root groups. These groups are no longer necessary in my new site. All I have ...
0
votes
0
answers
27
views
Short Url with FlexiContent Or Remove menu item alias from URL
I am using flexicontent for content management in Joomla 4.3.4.
And i created the Menu as
All content->Edited->News
As its URL with menu item alias
my-domain/all-content/edited/news/content-...
1
vote
0
answers
22
views
Rewrite rule in htaccess in joomla 4?
In J3 i used specific rewrite rules in .htaccess that worked fine but doesn't seem to work in J4. Here's an example :
RewriteRule ^metier/([a-zA-Z0-9-_]+)\.html$ /index.php?option=com_content&view=...
0
votes
1
answer
18
views
OnContentPrepare not working in custom Joomla Plugin
I have made other plugins for Joomla 4 but I am still a novice. The past two days I have been searching for a solution, it's becoming quite frustrating. I have brought back my code in the php file to ...
0
votes
1
answer
14
views
Field doesn't have a default value
I have just migrated from Joomla 3 to Joomla 4 and have an issue in Ignite Gallery.
When I try to upload a new image, I receive the following error message:
Upload Error, Adjusting the uploader ...
0
votes
1
answer
34
views
Upgrade Joomla CLi script to handle bulk import of items into articles
I am upgrading a client's CLi script that is used to automatically bulk import news items into Joomla articles. The code was originally programmed for Joomla 3 and now needs to support Joomla 4.
I ...
0
votes
1
answer
44
views
PHP load class from namespace error
I have been using this doc to convert a client's CLi news import script from Joomla 3 to 4. The code has been stripped of all the JSON to article code for brevity.
I have gone over all of my code and ...
0
votes
1
answer
56
views
PHP: Need to know how to trigger onContentAfterSave on existing article
I have what I thought would be a simple challenge: to automate publishing an article and trigger the onAfterContentSave event for saving the article. This code ultimately has to run within another ...
0
votes
0
answers
14
views
add bootstrap menu instead of the default menu
I would like to make menu on mobile devices have the same behaviour as Bootstrap menu, right now the menu slides from right to left on mobile, i want to change this to toggle-open from top to bottom ...
0
votes
0
answers
4
views
How can I set Cache TTL for my font files with htacces?
My site is very good I think in pagespeed
https://www.glansbeton.be
But I have a problem with my 2 fonts
https://pagespeed.web.dev/analysis/https-www-glansbeton-be/l7cuaewka9?form_factor=mobile
The ...
0
votes
0
answers
26
views
Joomla 4 db prepared statement re-write
I am migrating a componenet from J3 > J4.
I am stuck with some db code (not my strongest).
Maybe there is a kind soul that could re-write this code so it works with J4 and i could onwords :-)
...
0
votes
1
answer
107
views
Overwrite Site Model getListQuery
I have a System Plugin to filter Joomla 4 Category Blog Articles by Custom Fields. The Plugin basically overrides the core content ArticlesModel by loading it in the onAfterRoute Event like this:
...
0
votes
1
answer
27
views
J4 REST API Get users how to filter?
The J4 REST API allows me to GET a full list of users, but I have not found any example of how to filter such a request, for example by searching by userID or email.
When I look at the code for the ...
0
votes
0
answers
40
views
How to authenticate a user with the official Joomla 4 REST API?
I am developing a mobile app that needs to authenticate users with a Joomla 4 site. I want to use the official Joomla REST API to do this, but I couldn’t find any information about how to authenticate ...
0
votes
1
answer
37
views
Joomla 4 Router forward to Controller function
For a Joomla 4 component I just cannot figure out how to successfully forward or call a Controller function from within a custom Router.
This is the Controller - it basically loads an image:
<?php
...
0
votes
1
answer
23
views
Create date fields with the default null value facing error incorrect date field in Joomla 4
Create a date field in the XML form
field name="nextdate" type="calendar" class="inputbox" filter="safehtml" label="COM_COMDATE_FORM_LBL_COMDATEDETAIL_NEXTDATE" description="...
0
votes
1
answer
27
views
Tags not saving for Joomla category custom component with the correct entry in the #__content_type for the Joomla 4 and Jooma 3
Created field type category in the custom component com_drawing
but not able to save the tags in the category(refer to the image)
Table entry in the table #__content_types
INSERT INTO #...
0
votes
0
answers
17
views
Sendmail by using Joomla! settings is very slow
In my Joomla! 4.2+ component, i have something with send mail when an user submit a from, the issue is that the sending mail process is very slow. My component fetch the mail settings from the Joomla! ...
0
votes
1
answer
53
views
Cannot access form in Joomla 4 frontend
In Joomla 4.3.4 I have created a menu item Create Article for a specific category. When I try to create a new Article and enter the edit view, I get the following error:
0 htmlspecialchars(): Argument ...
2
votes
1
answer
48
views
Filling custom fields when creating an article with an script via the API
I am creating an article in Joomla 4 using the excellent code that is suggested here: Joomla 4 create article programmatically
My task is write the values of the custom field simultaneously with the ...
0
votes
2
answers
71
views
$this->params() is Null in Joomla 4 Plugin
I have a Joomla 4 plugin that uses a ServiceProvider which basically works fine. It's just that I can't access the plugin's configuration parameters.
namespace <Domain>\Plugin\System\Replacer\...
1
vote
1
answer
29
views
[J4]Trying to add a user to Group with addUserToGroup()
I'm trying to use the UserHelper::addUserToGroup() to add a usergroup to a user. This is in my component when I publish one of my records, I want the owning user of that record to be added to a ...
0
votes
1
answer
38
views
how to update item by using ajax on custom component joomla 4
Dears
My component was a bit old. So I started to do it again on joomla 4. I have been looking for a few days, how to update or create data items by using Ajax in joomla 4.
i found a lot of feedback ...
0
votes
0
answers
22
views
Joomla 4 - hide custom fields in category blog
I am using some custom fields at article level. These are also showing on the category blog view. How do I disable these? Am I being stupid or do I really need to create an override for such a trivial ...
0
votes
1
answer
50
views
htaccess QSA not working in Joomla 4
Migrating a Joomla 3 component to Joomla 4 I have problems with getting Apache Server htaccess correctly configured to append query string from request to substituted URL - QSA flag. - It looks like ...
1
vote
1
answer
80
views
Legacy component + jquery + SEO = 404
I have a legacy joomla 4 component that saves something back to the server using jquery. It works fine with SEO turned off, but I get a 404 error with SEO turned on. The URL parameter for the jquery ...
0
votes
2
answers
71
views
Casseiopa template - Bootstrap Carousel
I am trying to display a carousel in an article using the bootstrap code.
This is a new Joomla 4 install using the casseiopa template. Here is my code:
<div class="d-flex justify-content-...
0
votes
1
answer
47
views
J4 URL routing - cannot remove menu alias from URL - SEF issue
I've migrated a J3 site to J4 and have an issue with article URL's. In J3 an article would load /category/article i.e. https://old.lymington.com/133-locally/1458-a-guide-to-beaches-near-lymington-and-...
0
votes
2
answers
21
views
Href properties of the main menu items are empty just on the live site
I have updated a website from Joomla 3 to Joomla 4 on my local machine.
When I upload it all the main menu items are shown on the frontend with the HREF fields empty.
I can't understand why this is ...
0
votes
1
answer
40
views
Passing the current user to an external php file
I'm updating a working J3 system where one menu item is an iframe wrapper which runs an external php program which needs to know the current user.
I've been updating the first part of this file to use ...
1
vote
1
answer
90
views
How to load and render a view of a component from another's component template file?
Note: Question fully updated with the latest findings:
I want to load a com_contact contact view inside a template override of an article.
I have a contact item id and trying to load the record and ...
0
votes
2
answers
42
views
ALERTS FRONTPAGE
I have alerts in frontpage that I have not been able to fix for months
https://redes.editorasalvaje.net/internet
https://redes.editorasalvaje.net/rural
https://redes.editorasalvaje.net/recursos-...
0
votes
0
answers
29
views
Review of php script to clean up orphaned images / pdfs on joomla 4
I have written the following php script and would like some critique of the script and suggested improvements.
My motivation was to reduce server backup times and save energy by not backing up ...
0
votes
1
answer
22
views
Can we create single view in Joomla four without table file to just HTML code
I want to create a single view=help to display HTML code instead of the form view=item&layout=edit to the Joomla 4 Components administrator area, is it possible to achieve it?
right now I am ...
0
votes
0
answers
19
views
Linking to a category list item
I have a Joomla 4 menu item of type "List All Categories in an Article Category Tree". The menu item is FAQ, which sits under another menu item labelled Help. There is a category with an ...
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 '&...
0
votes
0
answers
22
views
Joomla 4 Backend select menu item that "should" be active
My new component will have an Import View in the backend where the users are able to import db stuff.
Because there are multiple types like teams, players, locations, referees, ... the imports are ...
0
votes
1
answer
155
views
Cannot access protected property Joomla\CMS\Menu\MenuItem::$params
Updating a demobar component from J3 and the view will not get my demo items for the dropdown from my model. Hoping someone could help me with getting the proper parameters for the menu.
I am getting ...
1
vote
1
answer
84
views
How do I create a sticky sidebar in Joomla 4?
I would like to create a sticky sidebar in Joomla 4. In other words, I would like to display a module next to an article in one of the sidebar positions. When the article scrolls up, the module must ...
0
votes
1
answer
38
views
Force 404 error in J4 when php file called
this is related to my previous question regarding [native J4 redirects][1]. I'm looking at a workaround but my previous question is still valid.
I'm using [Jbusiness][2] and where previously we could ...
0
votes
1
answer
30
views
Jinput getAray not retrieving RAW details from codemirror editor in Joomla 4
I am busy with a project to convert an Joomla 3 template to Joomla 4. The Jinput is not giving me RAW data it is removing the script tags from my inputs. I worked through a couple of similar problems ...
1
vote
1
answer
19
views
blog news with inside article summary and login form to read the whole article
I have a need to create a news section but which is password protected via login form. What I can't find is the ability to show a small summary of the article and then show the login/registration form ...
0
votes
0
answers
31
views
Joomla 4 AJAX request and Cyrillic characters
There is an input field of type text - pib_input
I am sending to the Ajax server
let pib_input = $('#pib_input').val();
console.log(pib_input);
$.ajax({
data: { [token]: "1&...
0
votes
0
answers
32
views
Joomla 4.3.3 Imported Redirects not working
more of a query than anything. I've imported some redirects using the Import option in J4 but I've just noticed that if the original page still exists, the redirect does not work.
It does say in the ...
1
vote
0
answers
34
views
Missing /media/cms/css/debug.css
While using browser developer tools I noticed an error in my joomla 4 site:
Refused to apply style from 'https://[server]/media/cms/css/debug.css'
because its MIME type ('text/html') is not a ...