Questions tagged [joomla-api]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
29 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
1answer
55 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
1answer
36 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
1answer
27 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
1answer
82 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 ...
1
vote
1answer
39 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 ...
4
votes
3answers
356 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
34 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
50 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
91 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
40 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
88 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
284 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
36 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
28 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
55 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 ...
1
vote
1answer
108 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 ...
2
votes
0answers
54 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 = ...
3
votes
1answer
90 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 ...
3
votes
2answers
530 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
58 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
570 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
50 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
316 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
20 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
288 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
204 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
1k 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
59 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
406 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
123 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
120 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
68 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?. ...
1
vote
2answers
322 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
289 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
227 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
76 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 ...
2
votes
2answers
152 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
93 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
95 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
419 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::...
1
vote
3answers
259 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
3answers
829 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
70 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
229 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
650 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 ...
4
votes
1answer
267 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
71 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
126 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
8
votes
2answers
1k 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 ...