Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [joomla-api]

This tag is for questions related to the Joomla-API, both Joomla CMS and Joomla Framework.

4
votes
3answers
56 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
1answer
30 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 ...
1
vote
1answer
31 views

Admin side login template override, extra field on login

I want to add an extra field onto the admin login page. I already have the front end login override sorted, just having trouble with the admin side. I copied file. administrator/components/com_login/...
-1
votes
1answer
55 views

Joomla component cron [closed]

I am developing component for Joomla and I do not know how to make cron. I can not use linux commands because it is complicated for users. Thanks.
1
vote
2answers
30 views

What are the differences of Joomla modules vs components vs plugins?

A very basic question probably... But what are the differences in Joomla terms between: module components plugins If I am a developer for Joomla what and why should I name it a module, component, ...
3
votes
4answers
73 views

Joomla API for identifying if new visitor?

Is there a API or possiblity to identify in joomla if the user is a new visitor, who visits the page the first time or a defined period passed? To be specific, the user is not registered joomla user, ...
3
votes
1answer
28 views

How to get URL parameter via Joomla api with decoded strings?

how can I get the full url parameter with the url-encoded values ?myParam=dummy%C3%B6%C3%A4%C3%BC this is the decoded url: ?myParam=dummyöäü if I use $myText = urldecode(JFactory::getApplication(...
2
votes
1answer
27 views

Load language file in view constructor

I'm trying to break up my translation strings into several files and avoid parsing them all on every request. I know base language files are loaded at Joomla! application initialization. From the API ...
0
votes
1answer
19 views

Where is `getParent()` method on `$parent` in installer class coming from?

The Joomla! MVC development docs for writing an intall script gives an example com_helloWorldInstallerScript. That class has an install() method, with this example: $parent->getParent()->...
0
votes
1answer
27 views

JFile::makeSafe does not convert file name

I need to rename and save a file upload when saving an item in a custom component. The problem is that the JFile::makeSafe function seems like is not converting the filename as you can see below. So ...
0
votes
0answers
9 views

Extensions for reading and writing to CRS API using XML/JSON

Im working on a site for a hotel to display the rooms available and allow for booking via their Central Reservations Systems API using XML/JSON. I was wondering the best approach and what extensions ...
1
vote
1answer
45 views

Error! Could not find a Joomla! XML setup file in the package

I'm looking for an extension to serve my Joomla 1.5 websites contents as REST, after some search I've found https://extensions.joomla.org/extension/rest-api/ component, but there is no specification ...
0
votes
0answers
23 views

login a user and granting core permissions

I am working on a project which requires some manager level access to perform tasks, so when I receive a call I forcefully logging in the request as a superuser so that it will have all permissions to ...
2
votes
0answers
38 views

Why calling addIncludePath from self has different results than from JModelLegacy

I'm trying to get an instance of a com_menus model from within my component. The following code works: JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/models/'); $model = ...
0
votes
0answers
378 views

Joomla getting Jquery not defined after upgrading to (3.8.7)

I am getting uncertain errors in console afer upgrading Joomla to 3.8.7. I am getting (Uncaught ReferenceError: jQuery is not defined). Please have a look at following screenshot. I also tried adding ...
3
votes
1answer
82 views

What is the prefered method for sharing code and SQL queries in joomla 3.9+?

I'm developing a component that is targeting Joomla 3.9+. The code is not using the legacy classes and is instead using the new namespaces. The component will duplicate much of the functionality from ...
2
votes
2answers
124 views

How to Use IN Clause in Joomla Query

I am trying to select records where a column is in a suggested list if values using the IN clause. I have tried the query below but the system is not working. $db = JFactory::getDbo(); $...
0
votes
1answer
45 views

converting component from Joomla 2.5 to 3.x [duplicate]

I'm trying to convert a component from Joomla 2.5 to 3.x. I can't figure out what I'm doing wrong. The admin component controller has: class PatientinvoicesModelPatientinvoices extends JModelLegacy ...
2
votes
1answer
461 views

How to get the right URL for an article?

I'm developing a module for displaying list of articles. In order to find the URL of an article I use ContentHelperRoute::getArticleRoute($item->slug, $item->catid). By default, it returns the article ...
1
vote
1answer
43 views

looping thru an array, trying to select a unique row

I am following along the helloworld videos/tutorials on the joomla site and figured I would try displaying a table of numbers. I have been successful displaying the table as a whole but I would like ...
0
votes
1answer
212 views

Making Joomla 2.5 component compatible with Joomla 3

I have component in Joomla 2.5. I am trying to make it to compatible with Joomla 3.x. After few changes in the code, I get an error: Cannot extend from interface JController Then I change the ...
1
vote
0answers
18 views

JToolbarHelper contents disappearing when cache is enabled

I've setup my custom component using JToolbarHelper for navigation, following the standard set by base Joomla components. Each view contains some variation of the following: JToolbarHelper::title(...
1
vote
2answers
199 views

Do I Use the JDate correctly?

Actually I encounter a problem with usage of JDate. Joomla has a class JDate for managing dates. I tested the following code: $date = new JDate('2017-07-28 00:00:00'); $timestamp_jdate = $date->...
1
vote
1answer
131 views

Joomla Search Result Article Text Length: Text is truncated in strange places

I am using the Joomla Search module with a Menu Item pointed to '/search'. When a search is performed, the results list a linked title, a snippet, category and the created date. The snippet is ...
3
votes
2answers
817 views

Joomla 3.7.x PHP API set value of custom user field

I'm writing a PHP script that goes through the users, and reads and writes some custom user fields. The reading part is done, by the use of the FieldsHelper. It works nicely. However, trying to write ...
1
vote
1answer
51 views

Running install script on Module Installation: How can I set a module chrome programatically?

I have created a custom module and I want to change the module chrome to "none". This can be achieved in the back end, but I would like it as the default behaviour in case others use the module. I ...
2
votes
2answers
274 views

Replacement of deprecated enqueueMessage() from JApplication

I have noticied that method enqueueMessage() from JApplication has been marked as deprecated, but what is the replacement method for that ? Thanks by advance
1
vote
1answer
99 views

Replacement of deprecated setUserState() and getUserState()

I have just noticed that methods setUserState() and getUserState() from JApplication are marked as deprecated. But what are the replacements for these two methods ? Thanks by advance
0
votes
1answer
83 views

Extend the JRoute API?

there is a helper coded: JRoute::_(ContentHelperRoute::getCategoryRoute($item->id, $item->language)) It does precisely what I want it to do, but I need the same functionality for the "Featured" View....
0
votes
1answer
58 views

I want to create a module that shows the content of an article

I want to create a custom module that shows the content of an article, I need to know two things: 1) What form field should I use in order to select the article that I want to use from the backend?. ...
0
votes
0answers
37 views

Joomla 3.x connection and web services [duplicate]

I created a Joomla website that behave like a marketplace for hosting servers. I want to connect my website to another solution that automate the servers hosting and orchestrate billing etc.. The 3rd ...
1
vote
2answers
274 views

How do I implement Google Analytics userID feature in Joomla 2.5 for logged in users with PHP?

My Joomla template includes the analyticstracking.php file with the tracking script, which has worked great, however I'd like to implement Google Analytic's userID feature (for cross-device tracking) ...
4
votes
2answers
219 views

How to define Joomla permissions programmatically?

Preface Let me preface this post by saying that though I have considerable experience with PHP, I am not familiar with Joomla in any meaningful sense. What follows is based on assumptions about how ...
1
vote
1answer
179 views

Can not get handle to Joomla! application object

I am trying to write a php file to process a form submission. Here is the code I have so far: <?php define('_JEXEC', 1); if (file_exists(dirname(__FILE__) . '/defines.php')) { include_once ...
3
votes
1answer
67 views

How to use MVC in joomla-platform

Where to find examples of both on the basis of joomla paltform to write an app using MVC. How to use the controllers? How to use models? How to use views? Please do not confuse this issue with ...
3
votes
2answers
136 views

Get rid of 404 Errors after removing K2

I want to explain the issue so hopefully any body can help me I had a website that use to contain K2 Component on it for different reasons that website got destroy so I had it to redo the whole ...
2
votes
2answers
77 views

How to get latest Joomla version from Joomla API into custom component

Ok, so I've created a custom component that should provide a dashboard to users of the site. A critical piece of information on it, is the latest Joomla version according to Joomla. So if I would ...
1
vote
1answer
87 views

Is it possible to set lifetime of specific session variable on the client-side

In my website a user does some action that adds a new custom variable to the Joomla session. Is it possible to set specific lifetime of that variable in the session? Joomla 3.6.4
5
votes
1answer
398 views

Abandonware user self-registration procedure in Joomla core

Joomla 3.6 has two different controllers intended to create a new user: UsersControllerRegistration::register() defined in components/com_users/controllers/registration.php and UsersControllerUser::...
0
votes
3answers
152 views

How can I set the Page Heading via the Joomla API?

I can set meta descriptions and meta keywords as follows: <?php $document = JFactory::getDocument(); $document->setDescription("a meta description"); $document->setMetaData('keywords', ...
0
votes
2answers
667 views

How to retrieve request headers?

I am adding custom header in my request (sent from external app) to Joomla controller with a custom header added. How to retrieve the header in my controller? I tried using below but it gives me null....
1
vote
2answers
65 views

What would be the best approach to modify multiple articles' content programatically?

Joomla 3.6 + k2 2.7 hosted on my own linux server. I am assuming someone else's webmaster job. He has had hundreds of k2 items on hte site, with a major problem: most of the articles have some ...
0
votes
3answers
206 views

Develop Joomla CMS Component vs Joomla Framework App questions

I need to do a 'component' this component uses Joomla! com_users to login and then connect a external db the use a form for sql updates. In first time I install Joomla! and develop a custom component ...
0
votes
2answers
517 views

Making changes to a Joomla site via REST

Has the J! project got an official REST API that can be used to manage a running Joomla site? At this stage it looks like we will need to manage at least: articles, categories, tags and perhaps even a ...
5
votes
1answer
230 views

Is there an event like “OnAfterCompileHead”?

As per title, is there already an event that can work like a sort of OnAfterCompileHead? Maybe onAfterDispatch, onAfterRender or onBeforeRender? I need to change some meta tags in the <head> ...
-1
votes
1answer
69 views

Joomla insert article in helloworld component [closed]

I would like to insert an article inside my component, does someone have an example on how to do that? I created Helloworld component , I need to show items of articles in site component , How to ...
1
vote
3answers
115 views

Generate static html from the content of the site with Joomla 3.x api

anybody knows how to access to the content of a Joomla site through the API? I'm trying to create a component which download the content of my Joomla site in html. Thanks
7
votes
2answers
887 views

What is the Joomla Execution Flow, after a request reach to index.php till the final output on the browser?

Based on this question: How Templates work and load css/js files? Website building process with Purity III Quote: .... I have to present my website tomorrow and i may get asked "where does the ...
1
vote
2answers
93 views

Extending joomla registeration with a plugin

I have found a plugin that extends joomla's core registration by adding a new field named User group selector. There is a trigger method in this plugin named onUserAfterSave that save the custom field ...
2
votes
1answer
357 views

Create user with PHP with “Receive System Emails” set to no

I am creating a new user using this data: jimport('joomla.application.component.helper'); $params = 'com_users'; $usersParams = JComponentHelper::getParams($params); $new_user = JFactory::getUser(0); ...