Questions tagged [json]

json is an abbreviation of JavaScript Object Notation. It's a lightweight data-interchange format.

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

How to handle duplicate items coming from an external JSON API and being imported as article content

I have adapted working code from Joomla 3 and the CLI to Joomla 4/5 and the API. The core functionality using the API system is working, but I am struggling to find a replacement for checking for ...
Mike Hermary's user avatar
1 vote
1 answer
54 views

Input JSON strips HTML

I have successfully developed a Joomla 4 API which receives JSON data containing HTML to update the database. - The HTML markup is stripped away when using this code: $input = $this->input->json-...
cappu's user avatar
  • 137
0 votes
0 answers
111 views

I am trying to use joomla.asset.json for a custom template, but I get a white page - why?

I have created a custom Joomla 4x template called 'toccata'. I have a joomla.asset.json file (shown further down below). The file is listed in my templateDetails.xml file and I thought I'd done ...
Gillian's user avatar
  • 411
0 votes
0 answers
32 views

Can JLog be configured to write JSON to log?

I will be implementing Joomla's JLog library to log debugging and error data in my component, but our deployment specialist believes JSON to be the best format for logging. Is it possible to configure ...
kalinma's user avatar
  • 153
0 votes
1 answer
105 views

Add extra values to the the document in JSON API Response

I like to respond a Json like this '{"name":"John", "age":30, "car":null}' How is this possible with thos class: https://github.com/joomla/joomla-cms/blob/4.2-...
agi's user avatar
  • 303
0 votes
1 answer
157 views

Decode json strings from a database table column

I have a column in my database that essentially creates an array and I am essentially trying to explode it but I cannot figure out how to get it to work. Its also going into SQL with { characters ...
Brandon's user avatar
  • 69
1 vote
3 answers
330 views

Execute Joomla CLI script to bulk import JSON data to articles

I have the following PHP code working to bulk add array items from JSON to com_content. The code is executed by directly accessing the file in the web browser. For example, http://examples.com/json-...
Mike Hermary's user avatar
2 votes
1 answer
310 views

Invalid controller class from custom component ajax call to json method

I have an existing J3 component admin view which fires off a Javascript Ajax call to a Json controller and fetches back data which I then incorporate into that view. I'm trying to replicate how I've ...
Grant Hood's user avatar
2 votes
2 answers
380 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 ...
Mike Hermary's user avatar
1 vote
1 answer
860 views

How to output just raw json from my Joomla controller for Ajax requests?

I want to create a Joomla json response for an Ajax request. So, I followed the instructions here: JSON Responses with JResponseJson I implement the following code in my controller: use \Joomla\CMS\...
framontb's user avatar
  • 237
1 vote
1 answer
128 views

Query database and show latest 3 articles from __content

I need to show the latest 3 content items from the database. I want to show the: Intro Image Article title (with a link to the article) Published Date Intro Copy (limited to 100 characters) I have ...
RustyJoomla's user avatar
  • 2,076
1 vote
1 answer
159 views

Show images and caption from array as images in carousel

I have the following fields in a component: <fieldset name="carousel_container"> <field name="carousel" type="Repeatable" icon="list" description=&...
RustyJoomla's user avatar
  • 2,076
1 vote
2 answers
171 views

How to store component parameters after modification

As I understand it, the current values of a component configuration are stored as JSON in the params field of the #__extensions database table, in the entry that matches the component name as element. ...
mbrampton's user avatar
  • 314
3 votes
1 answer
2k views

How to use joomla.asset.json correctly?

I figured I need to reinstall a template/extension in order to take into account my changes to the joomla.asset.json file. Here is the file I'm currently using: { "$schema": "https://...
thednp's user avatar
  • 415
0 votes
0 answers
163 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 ...
Ahmed Boudraa's user avatar
0 votes
1 answer
32 views

Schema markup votes

Good evening. I need help with schema markup for product. Microdata or ld+json. I managed to markup content but i can't make aggregateRating to get rating from standard vote plugin. I tried several ...
johnl's user avatar
  • 85
1 vote
2 answers
79 views

Create dynamic html markup from values in repeatable field json

In my custom component, I use a repeatable field. Sometimes it is possible that a url_partenaire element is an empty string because it is not mandatory. var_dump($this->item->...
Laurent's user avatar
  • 23
1 vote
2 answers
1k views

Insert multiple rows into a database table using a loop

I am trying to insert post data inside a Joomla table. So within a loop I populate the query with the values of a decoded json but all the time I get this error: Column count doesn't match value ...
leno1232's user avatar
2 votes
0 answers
156 views

How to get an AJAX call in component's administrator side

I added a component to my site and it accesses my DB via an AJAX call. In my 'tmpl' folder, I have a 'default.php' file which makes an AJAX call that is received by view.json.php just outside that ...
LaioZatt's user avatar
1 vote
2 answers
151 views

How to display specific K2 extra field of current item with k2 tool module

I am trying to display specific extra field values of a specific item with the K2 tool module. I have tried to get just BRAND, but I'm getting stdClass::brand() error. $db = JFactory::getDBO(); $...
okisan's user avatar
  • 55
0 votes
1 answer
128 views

How can I create a custom list formfield from json

I need to create a custom formfield like so: https://docs.joomla.org/Creating_a_custom_form_field_type But the data I want to populate the list with is in a json file. So I can't really do a PHP ...
Eoin's user avatar
  • 1,889
1 vote
1 answer
58 views

Controller Joomla - Output Class construct for color css style

I'm trying to understand php class into Joomla and construct output. I've created this class into my controller.php: class ColorStyle { public $OpenJs = "<script>"; public $...
Andrea Suriani's user avatar
0 votes
1 answer
658 views

How to set HTTP header on Joomla's JSON response?

I am using Joomla\CMS\Response\JsonResponse to send a JSON response. $data= new \stdClass() $data->some_data = 1; $resp = new JsonResponse($data); echo $resp; How to set a HTTP header for the ...
ed22's user avatar
  • 125
0 votes
1 answer
172 views

How to pass a JSON file from a Plugin to a Component?

My intended application is to provide a list of products in a simple Joomla list/table display with check boxes where the end user can click on one or more items, press the print button and the data ...
Irata's user avatar
  • 3,597
0 votes
2 answers
583 views

Ajax Request returning the whole page not a specifc value

I am trying to make an AJAX Request to my function in my controller and it works, however, it returns me the whole page which i don't want. I have tried encoding it with json but no success i also ...
Thiago Guimarães's user avatar
0 votes
0 answers
70 views

JSON to String in Joomla

I have the following method to convert JSON to a String // Convert the JSON-encoded image info into an array $image = new JRegistry; $image->loadString($this->item->image, 'JSON'); $this-&...
Thiago Guimarães's user avatar
3 votes
2 answers
285 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 ...
MM PP's user avatar
  • 133
0 votes
1 answer
931 views

Click to upload an image "The server returned an invalid JSON response." [closed]

When I go into an article, and then click to upload an image I receive the error: The server returned an invalid JSON response. I actually receive the error twice in a row if that helps. Can ...
Eoin's user avatar
  • 1,889
0 votes
1 answer
218 views

How to get data from core components and modules formatted as JSON?

As I would like to use a front-end JavaScript framework within Joomla I would like to know what's an efficient and maintainable, structured way of accessing data from core components (such as ...
Wieger's user avatar
  • 253
1 vote
2 answers
368 views

How display values from subform in front end?

I created a simple component with a subform that stores data in a database. Now I need to display this data on the front page. The data is displayed as is from db {"comment0":{"comment":"one"},"...
Nik's user avatar
  • 13
5 votes
3 answers
2k views

How to save data from 2 fields as a JSON string to 1 database table field?

I need help to store data in json format in my DB like {name:'1', name2:'2'}. So far I have this: model/form/category.xml: <fieldset> <field name="name" type="text" ...
yaak's user avatar
  • 51