Questions tagged [joomla-api]
This tag is for questions related to the Joomla-API, both Joomla CMS and Joomla Framework.
207
questions
1
vote
0
answers
33
views
Joomla 4 API rename attributes
In Laravel, you can use eloquent mutator transforms to change field names (database table column name) to a preferred/alias property name. How can this be done in Joomla 4?
I know I could do this in ...
1
vote
2
answers
52
views
Joomla 4 API MVC Layer type
Is it possible to create a webservice and API access for my own component if the component file structure is not setup like this and uses namespace based classes?
https://docs.joomla.org/J4.x:...
1
vote
1
answer
12
views
Webservices returns The requested URL was not found on this server with a 404
When using Webservices on my local development environment, but the problem is not unique to local environments, I received the following message for even the core features,
The requested URL was not ...
2
votes
1
answer
88
views
How to initialize joomla modal through js
I'm customizing a view in my component, I have tabs, each tab contains a modal, but when adding a new tab using js, I don't know how to initialize the new tab's modal via js?
4
votes
0
answers
176
views
(4.1 -> 4.2) Attempted to load class TemplateComponent from namespace Joomla\Component\Administrator\Extension calling $app->getTemplate
I have a file test.php that manually loads the Joomla framework and prints template parameters.
<?php
// test.php, located in the same directory that index.php is
define('_JEXEC', 1);
define('...
2
votes
2
answers
53
views
Can we get the featured articles in a GET call through Joomla 4 API?
For now we have api/v1/content/articles, but this gets ALL the articles from the site. I do not need the whole list, just the featured articles.
Will we need to create an api-component as a temporary ...
1
vote
2
answers
62
views
Identify Joomla 4 API access
If I do an API call like this:
curl --location --request GET "http://127.0.0.1:8000/api/index.php/v1/users" --header "X-Joomla-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
I get ...
0
votes
0
answers
18
views
I have a problem with setup Joomla Trademark
Joomla sent me two link below, and i need update my site.
https://tm.joomla.org/disclaimers.html
For Extension Developer (JED) and Service Provider (JRD) websites:
[Business name] and this site is ...
1
vote
2
answers
66
views
Webservices Route
If I create Route for the API via
$router->createCRUDRoutes( 'v1/foos', 'foos', ['component' => 'com_foos'], true );
Like explainded in https://joomla.stackexchange.com/a/32322/7387 the Route ...
4
votes
2
answers
192
views
Joomla API and Credentials
I am taking my first steps in integrating the Joomla API. I used this tutorial: https://blog.astrid-guenther.de/en/joomla-webservices/
Now I am wondering if it is really necessary to include the ...
1
vote
0
answers
41
views
I can't get $params->set() to work to transfer variable from module to template
I'm trying to get a variable from my module to my template but its not working.
In my modules xml I defined:
<fields name="params">
<fieldset name="basic">
&...
4
votes
3
answers
506
views
Joomla 4 API Question
How to convert a custom Joomla 3 to Joomla 4, and use the Joomla 4 web services API?
I have an extension I wrote for J3 and with a bit of tweaking it works just fine in J4. I want to add web services ...
1
vote
1
answer
45
views
Joomla 4 API Issues using Joomshaper Melvin Template
It may be too specific a question, but is anyone having any issues utilizing Joomla 4 Templates and the API with extensions from Joomshaper? I have 1 site that seems to work fine, but another that is ...
0
votes
1
answer
59
views
Displaying API data in Joomla Component
So, this is a two parted question but both pertaining to REST APIs. I am developing a component for Joomla in which I have a few database fields (ie. teamid and platform) that are stored in the local ...
2
votes
1
answer
89
views
Is showing a Joomla API token in JS a security risk?
I have created a couple of web services under Joomla 4 that are simple enough calls to the same website to refresh a couple of fields when something else changes. In my JS code I have the 'X-Joomla-...
1
vote
1
answer
69
views
cant display simple text onContentPrepare
I just want to display simple text and this is not working.
I don't know is there a way to see something like log to see what happens in the background?
public function onContentPrepare($context, &...
1
vote
0
answers
86
views
getting first image of article for open graph
I've been a PHP developer for long time, but I am new to Joomla.
On a Joomla 2.5 project, I need to make open graph meta tags. As a part of open graph meta tags, I need to find first image of article. ...
2
votes
2
answers
283
views
Integrate external news content API into com_content articles
My client is looking to integrate news content coming from an external API into their Joomla website. The API is in the JSON format and includes multiple fields like title, summary, date, and full ...
1
vote
1
answer
414
views
Joomla 4 - get module params in external php
In Joomla 3, I get module params with this code:
// Create the Application
$app = JFactory::getApplication('site');
$module = JModuleHelper::getModule('mod_dev');
$presetParams = new JRegistry($...
2
votes
1
answer
175
views
Are custom fields updatable using joomla 4 api?
Simply put when using the API to update a custom field of an article, the new information is not successfully passed through. Furthermore, the original contents are deleted from the field.
The ...
1
vote
1
answer
124
views
J4 API - There are two variables for Article Text, why do neither work on PATCH?
While working with the new Joomla 4 web services API. The Article text does not update. Additionally, as per the documentation, when creating an article via API the article text variable is ...
4
votes
2
answers
370
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 ...
1
vote
2
answers
138
views
How to create joomla plugin with jquery code
What is the best way how to add jquery code by Joomla plugin?
How can I set that these code should be applied just for checkout page of VirtueMart in xml file?
Is this the best way?
<?php
// no ...
0
votes
1
answer
120
views
Upload single or multiple files replacing deprecated JRequest::getVar('file', '', 'files', 'array');
I am trying to upload a single or array of files and am not sure how to use the jinput with the array and filter. Tried multiple suggestions from here and documentation and cannot make it work for me.
...
1
vote
1
answer
166
views
What is the correct way to use appendBody
I'm trying to understand appendBody
First of all append would seem like it comes after the </body> but I assume it can only mean after the contents of the body. And prepend before the contents ...
2
votes
1
answer
72
views
Reset list option-value when changing showon value
I am currently writing a module with many backend settings, some of these use the "showon" attribute.
For example: I have two fields of type "list". In the second one, the options ...
0
votes
0
answers
120
views
Adding Azuracast JSON file to my AM HTML5 AUDIO PRO PLAYER in joomla
I need help for a problem that i didn't found solution.
we have a web radio created with joomla and we start to put our programs 24h/24.
I bought an AM HTML5 AUDIO PRO PLAYER and everything work fine ...
2
votes
2
answers
91
views
What does it mean for a user to be 'logged in' to Joomla?
I am having an issue with the ACL of my Joomla API. I created this using the TechJoomla api component.
I have the following code to handle post requests on my api.
<?php
use Joomla\CMS\...
2
votes
2
answers
387
views
What is url for calling task in controller for Joomla 4?
This is my ajax query for calling a task in the controller (it works for Joomla 3 but doesn't work for Joomla 4):
$.ajax({
type: "POST",
url: "index.php?option=com_scrib&...
1
vote
1
answer
106
views
Router, keep only item alias in SEF URL
For a particular reason, I need to keep in the SEF URL only the alias of the item to have a URL like this www.mywebsite.com/**myItemAlias** but of course without creating a direct menu to the item ...
1
vote
1
answer
189
views
How can I make a custom controller for a Joomla based api?
For my latest project I need an api that responds to a 'POST' request by returning json text that depends on the content of the 'POST'.
I have made a version of this in loopback, however I can't think ...
0
votes
0
answers
36
views
Assign a template to a category with a plugin system and onAfterInitialise event
I would like to assign a specific template for a certain category, I have tried with this code in a plugin system but without success (this code does not include the condition for the category I will ...
2
votes
1
answer
105
views
Impossible to create new Joomla User with User Class : Please enter your name
Dont' know why but since Joomla 3.9.22 (or 3.9 ?), when I create a User with User Class, I have the error "Please enter your name". But the name field is not empty.
Here is my simple code :
$...
1
vote
1
answer
234
views
Does Joomla CMS or Joomla Framework provide any Class for making POST request to an external API?
I came across:
the documentation for Joomla's HTTP client class and
joomla/http in packagist
Are they the same thing? Are these capable of sending POST requests to an external API?
1
vote
1
answer
98
views
HTMLHelper::isRegistered what is it used for?
In Joomla's profile plugin, I came across these lines of code
if (!HTMLHelper::isRegistered('users.url'))
{
HTMLHelper::register('users.url', array(__CLASS__, 'url'));
}
...
0
votes
1
answer
178
views
Joomla custom SSO plugin
I need to create a custom SSO plugin. The way it should work is:
User authenticates on 3rd party application
3rd party application calls a Joomla URL via POST request
The URL that has been hit deals ...
1
vote
0
answers
43
views
Upload and attachement for phpmailer
hello i starting an code to allow sending file via a form
i create an input file field
<input type="file" name="'.$field_name.'[]" accept="'.$values_field[0].'" id="'.$field_id.'" '.$placeholder.' ...
0
votes
1
answer
236
views
Joomla post requests
I'm trying to make an android application and so i want to connect it directly to my Joomla website, i want to send some post requests but they are getting denied, I'm not asking for any help ...
3
votes
2
answers
165
views
Why are Joomla url query strings commonly delimited with "&" instead of "&"?
I often see Joomla url querystrings with & delimiters between key-value pairs instead of the standard &.
In a previous question, How to make my Editor plugin (type: editors-xtd) survive ...
5
votes
1
answer
705
views
What is the correct way to programmatically delete a joomla user and their data?
I want to remove a set of users by id from a Joomla 3.x database. I am trying to figure out from the documentation if this is possible without having to write my own SQL for each database table.
...
0
votes
0
answers
112
views
Change default backend language programmatically
I have a component installed which doesn't provide multilingual support.
If I import data via the API, I can't import in a different language, only in the default backend language.
Unfortunately, ...
3
votes
2
answers
235
views
Crawling Joomla websites without parsing website's html
Nowadays many crawlers are using the REST Api features of most CMSs, to be able to crawl websites fast. WordPress and Drupal have their own REST interfaces so indexing any WordPress website is a ...
0
votes
0
answers
81
views
API to read and write http headers?
I am wondering what is the best way to read and write http headers in Joomla?
What do I need to achieve?
I want to read all requests headers
I want to add response headers
I want to control optional ...
2
votes
1
answer
102
views
How to measure server performance in joomla (not from outside)?
I am wondering if where is a option to measure the joomla performance on the api level.
something like this (afaik it is profiling)
Time: 56.14 ms / 56.14 ms Memory: 0.593 MB / 0.81 MB ...
0
votes
1
answer
162
views
How to get the canonical SEF URL of an article in PHP?
Is there any way to get from the article it's SEF URL?
<?php
$id = JFactory::getApplication()->input->getInt('id');
$article = JTable::getInstance("content");
?>
searching ...
0
votes
1
answer
427
views
get intro-image from article?
I do not get the images out of my article. The article var is initialized, but the images and pictures vars seem to be empty. Any hints what I do wrong here?
<?php
$id = JFactory::...
4
votes
1
answer
185
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 ...
2
votes
1
answer
112
views
Adding redirect to redirect component from custom component
Is it possible to add a redirect to the redirect manager from my custom components controller or model? I want my custom component to add a redirect to the redirect manager on deletion of an item. I ...
5
votes
3
answers
2k
views
Is there a way to add rel='preload' using addScript/addStyleSheet?
I want to display some of the styles and scripts using rel='preload' to make my pages load faster - referring to the Google Lighthouse.
<link rel="preload" href="style.css" as="style">
<link ...
2
votes
1
answer
109
views
Number parsing and formatting, according to the user locale
I'm wondering if there is J-API way to parse and format numbers (like JDate).
When you convert decimal numbers into different locales, the user can enter numbers in this way "1.234.567,891" and ...