Questions tagged [development]
This tag is for question about the development of features or extensions in Joomla.
360
questions
1
vote
1
answer
51
views
How to remove a file from a template using the installer?
I am developing a template for a small group of sites. In the old J3 days, I had to make an override for some core templates to fix some minor things. With the update to J4 this was no longer ...
1
vote
1
answer
112
views
Trouble linking external css file with Dompdf library
I'm trying to create a Joomla system plugin enabling a user to generate a pdf based on a template. I'm using the Dompdf library. I managed to create a PDF, but linking to an external css file isn't ...
1
vote
0
answers
45
views
Joomla 3.9 CORS error
I'm trying to allow CORS on my website but I can't get it to work.
I've seen many posts about this, from updating .htacces, httpd.conf, meta tags, and php headers, but nothing worked. I always get a ...
4
votes
1
answer
201
views
Coding Standard Question - defined( or \defined(
A general Joomla! coding question... Checking _JEXEC is defined.
In administrator/components/.../src/everywhere it is
defined('_JEXEC') or die;
use function defined;
Whereas in components/.../src/...
1
vote
0
answers
27
views
How to programmatically change a page's meta tag?
I am making a very simple product page for my site. With very little component development experience, I decided to build this page with Javascript only. The URLs will be like https://mystie.com/...
1
vote
1
answer
18
views
Event for user creation in administration
Is there an event like onUserCreation() for the backend in J3? So if an administrator creates a new user, specified code (e. g. from plugin) is executed. In the API guides I didn't find any obviously ...
1
vote
0
answers
38
views
Codeception Acceptance Testing issue using session snapshot
I think i read almost all similar reccources considering this issue, but nothing helped so far.
I am moving our Codeception tests on Github Actions. The whole build process is running but the ...
1
vote
1
answer
38
views
Codeception Acceptance Test Issue with JoomlaBrowser
When trying to write a simple Acceptance Test only creating a new Joomla Article Blog Menu Item, I'm doing this:
$I->createMenuItem('Blog', 'Articles', 'Category Blog', 'Main Menu');
I get this:
...
1
vote
2
answers
92
views
How to use SQL statements not supported by JDatabaseQuery
Recently, I have needed to use some SQL statements that are not supported by the JDatabaseQuery class, specifically REPLACE INTO and INSERT IGNORE. The only way that I am able to get something to ...
2
votes
1
answer
139
views
How to open a new window/tab or modal from within a component
I am trying work out how I can pop up a modal or open a new window or tab when selecting a button on a form that processes the form and passes to another extension? I can't seem to find any examples ...
1
vote
1
answer
44
views
Restrict access to your paid extension
Our company is wanting to deploy a pro and free version of our extension onto JED. Is there any way that I can prevent people with the free version from hacking to get the pro version? I would like to ...
1
vote
0
answers
25
views
Form With Buttons That Don't Submit Data
I am trying to make a page that performs various functions in vanilla Javascript.
One of the functions involves submitting form data to Joomla.
However the issue I have is that Following the following ...
1
vote
1
answer
88
views
How to use Openlayers transpiled Javascript code in my own extension (a "bundle")
I am developing a Joomla 3.x content plugin to display Openlayer maps in articles based on @Robbie Jacksons excellent tutorial at https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_a_Map ...
3
votes
3
answers
153
views
Multilingual site where several countries share the same language
I'm making a multilingual site where I'm using Spanish, English, German, and others.
I have already made several multi-language sites and I am familiar with the process but in this case, my client ...
2
votes
2
answers
77
views
Reroute all emails to developer / debug address
I am trying to intercept outgoing emails from joomla and reroute them to my email address for development and testing. Ideally I could set up a toggle under Global Configuration > Server > Email ...
0
votes
1
answer
53
views
How to write Joomla functionality that writes image data directly to the browser?
I am in the process of writing Joomla functionality that will produce JPEG-images on the fly using Imagick and GD. It is supposed to be used in Joomla articles like this:
<IMG src="/index.php?...
0
votes
1
answer
31
views
Reason for parameter for using custom fields in configuration
In the Joomla Core Extensions we have a parameter for selecting if custom fields are used in an extension or not. For example here: https://github.com/joomla/joomla-cms/blob/staging/administrator/...
3
votes
1
answer
92
views
How to replace deprecated Joomla classes with VS Code?
Is there a way to conveniently replace deprecated Joomla classes with VS Code. I do have the PHP CodeSniffer (with Joomla Coding standards) and Intelephense extensions, although I am not sure if ...
0
votes
2
answers
306
views
How can I generate a stubs file for Joomla?
I'd like to develop Joomla components with VS Code.
With PHP Intelephense enabled, all my file show errors because I use Joomla classes and functions. (And it would also be convenient to have auto ...
1
vote
1
answer
39
views
DPDocker and Joomla
I'm new to Docker. I tested https://github.com/Digital-Peak/DPDocker. I was able to implement things quickly with the component https://github.com/Digital-Peak/DPAttachments.
Now I'm in the process of ...
1
vote
2
answers
148
views
Use addScriptOptions for multiple modules on same page
I am passing some params to JS in my custom module using the addScriptOptions provided by Joomla:
$document->addScriptOptions("mod_mymodule", $params));
This works fine, as long as there ...
1
vote
1
answer
1k
views
Pass PHP variables to CSS?
I want to pass some variables to my css, without using inline styles. During some research I found different sources pointing to the same solution. For example here on the Joomla forum.
Basicly they ...
0
votes
1
answer
106
views
Joomla php function which prints the pagename
Is there a php function to insert in the template which prints the name of the menu item of the displayed page?
0
votes
1
answer
67
views
Creating a Library with multiple classes within a single file
I am trying to incorporate an external application as a library within Joomla which I have done before on a couple of occasions, however in this case there is a single .php file with about 20 classes ...
1
vote
1
answer
56
views
Problem accessing database from front end of a component
I am currently working on a component which will display "events", stored in a database, on a map (filterable by location, category, date etc...). My first step is to display a simple report of the ...
2
votes
1
answer
322
views
In front end of component use the Admin controller and model to delete records
I would like some help in using the delete() methods of the AdminController and AdminModel when in a front end list view to avoid duplicating code unnecessarily.
I have a listing of records in a ...
1
vote
1
answer
138
views
What is the different between JPlugin and \Joomla\CMS\Plugin\CMSPlugin
I was learning plugin development when I came across this.
so for some plugin, I see
class pluginA extends JPlugin
for some others, I see
class plgGantryEasyblog extends \Joomla\CMS\Plugin\...
1
vote
0
answers
56
views
List every contact including the ones in subcategories
I need a phone book with all people of the organization, but also need a separated phone book for each department. We have a "Main" category, with a few subcategories. I cannot duplicate the personal ...
2
votes
0
answers
122
views
FieldsPlugin onCustomFieldsPrepareDom $field on save different on front and backend
I currently develop a FieldPlugin for myself. I noticed some things and don't understand them fully right now. My plugin works in the backend perfect, but raises errors on the frontend, so I did some ...
3
votes
1
answer
59
views
Why is my plugin not hooking into events?
I have a plugin that looks like this:
class plgExtensionLogInstall extends JPlugin
{
function onExtensionAfterInstall($installer, $extensionId)
{
JLog::add("Extension installed: ".$...
1
vote
2
answers
102
views
How to remove excerpts in joomla articles
On my homepage, I am listing all my blog posts from a category. I don't want to show there any excerpt of articles neither full article instead of a title and featured image. How can I achieve that?
0
votes
1
answer
39
views
Remove tag association when deleting an item in own component
I followed the MVC Tutorial from Joomla as close as possible to create my own component. I included Joomlas Tags system within my component using the Observer technique in the JTable class
class ...
4
votes
1
answer
154
views
Get form input in custom field
I'm currently working on a custom field, where I manually add a checkbox to a file upload field.
PDF Upload field
In onContentBeforeSave I want to read this checkbox to decide what to do with the ...
0
votes
1
answer
84
views
Accessing path to tmp directory in my component
How can I access in a custom component the full path to tmp directory configured in the Joomla configuration? I have changed the tmp directory to be outside of the Joomla! installation.
0
votes
1
answer
48
views
How to write a complex installer script for a component?
I would like to ask the user some questions in a dialog way during installation of my component. As far as I know, this could be done in the preflight method. But I am not sure how to do user ...
2
votes
2
answers
197
views
How to configure Eclipse Project for Joomla Component Development
I like to develop a fresh Joomla Component for Joomla 3.x in Eclipse and created therefore a simple PHP project.
The problem I have is now how to setup the correct "include path", so that the basic ...
0
votes
2
answers
142
views
Getting post installation script to run for a module
I've a module that I want to run a script post installation, post update etc.
I think this can be done by adding a script.php into the module zip file and then calling it in the installation file.
&...
1
vote
1
answer
353
views
From outside of a component how to change a parameter
In a system plugin, I am using the onAfterRoute event to change a single parameter from a 3rd party component before being loaded.
public function onAfterRoute()
{
if ('com_abc' == JFactory::...
2
votes
2
answers
828
views
Using external PHP library and defined('_JEXEC') or die;
I want to use hatemile-for-php library (https://github.com/hatemile/hatemile-for-php) in my plugin.
As I am only ever using this library within this one plugin, I included it in the plugin folder ...
1
vote
3
answers
66
views
Develop a System Plugin with Sample Data for Options
I'm in the process of developing a system plugin. In the options is a subform-field (repetable), which contains several fields. In the "default" of the subform I can specify a record.
a) How can I ...
3
votes
1
answer
2k
views
How to write a query with GROUP BY and ORDER BY using Joomla's query methods?
I have the following query that I need to convert to Joomla using JDatabase. This query executes as intended in the phpMyAdmin.
SELECT `id`, DATE_FORMAT(`estEventDate`, '%b %Y') AS estDate, COUNT(`id`...
2
votes
1
answer
64
views
MVC what stage sets a task if none provided
I am trying to understand Joomla's MVC logic. please help me figure out the processing of the task
Unedited code from a Joomla package has the front end article edit form with the task field, but its ...
1
vote
1
answer
454
views
How can I add custom user field values to an article?
I have created a custom user field named "Gender".
How can I show this field in an article?
I can only manage to show: username, name, email and User Id
Here is my current Sourcerer code to access ...
1
vote
1
answer
441
views
in Joomla 3.8 default search tools do not respond in my own component and cannot set and get state of the filters
I try to get some help from you to spot what I am doing wrong (what I am missing) on applying search tools and filters in the admin of Joomla 3.8 in my own component.
I am pulling my hairs out since ...
0
votes
1
answer
51
views
How do you start new project design implementation? [closed]
You choose the framework and extension for your new website project and actually all is set. The designer sends you some Photohop files with new design.
I tried to find online some instruction what ...
1
vote
1
answer
95
views
Get whole POST with JREQUEST_ALLOWHTML
In order to get the whole POST I do
$app = JFactory::getApplication();
$jinput = $app->input;
$data = $jinput->getArray($_POST);
that works ok.
But I want to apply the filter ...
1
vote
2
answers
554
views
Change user default language programmatically
In a custom component I'm making, I need the user, in his private area, to choose the default language for the web.
It is a custom form, and I already render the language selector, but I don´t know ...
2
votes
1
answer
547
views
Reload admin form after save field in database
In a custom component I need the user in the edit view of an item to be able to load a field in the editor field through modal and ajax.
The case is the user can fill an editor field from a text ...
1
vote
1
answer
503
views
file upload in admin backend - custom component
In my custom component/admin, in the item edit template I am trying to let the user upload a file.
The problem is that the file is not being passed in my save function. There is not even in the array ...
1
vote
1
answer
740
views
Get com_contacts item by id?
I need to get a com_contacts item the same way Joomla does (so I can re-use a template for example). I know I can get the item by querying the database directly, but that won't prepare things the same ...