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
1
vote
1answer
812 views

Joomla-Development: Set default view

I would like to set up a default view. If my component gets called by using administrator/index.php?option=com_bestia&view= I'm getting the error: 404 View not found [Name, Typ, Präfix]: bestia,...
4
votes
1answer
71 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. ...
6
votes
1answer
391 views

Implement CSRF anti-spoofing using the Joomla Framework

I have used the methods described on this page in Joomla many times before: http://docs.joomla.org/How_to_add_CSRF_anti-spoofing_to_forms Now I want to implement the same mechanism using the Joomla ...
6
votes
1answer
1k views

Using checkToken() to secure form posts

I am building a web app using the Jooma Framework and the Framework App as a template. I have getFormToken() working as described in this post and am now submitting the token with my form but I cannot ...
2
votes
2answers
728 views

Get access level for a URL

How could I get access level for a given URL? I need to know if a URL is accessible for registered or only guests users.
3
votes
2answers
969 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
0answers
26 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, ...
0
votes
1answer
58 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 ...
6
votes
3answers
11k views

How to get the intro image of a joomla article

I am trying to customize the the category list of my website. So I have a menu option that shows the list of all article is a certain category. In this list I would like to show the into image of the ...
2
votes
1answer
32 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 ...
1
vote
1answer
92 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 ...
6
votes
3answers
699 views

Joomla/PHP How can a plugin append a css class to the body section?

Hello Joomla Community, How can a css class be appended to the <body> from inside a system plugin? Any advice is appreciated, Thank you.
0
votes
0answers
33 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 ...
5
votes
2answers
4k views

How to do SQL exception / error handling compatible with 2.5 and 3.x?

I was trying to develop Joomla 2.5 and 3 component. As many things deprecated between these two versions and the way to throw and catch database and other errors, I could not find ways yet to make ...
2
votes
1answer
64 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 ...
2
votes
1answer
45 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 ...
0
votes
3answers
929 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....
0
votes
1answer
31 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
90 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 ...
3
votes
1answer
2k views

Get/set userstate and session variables not working inside for loop

I have a long loading for loop inside a function in one of my model in my Joomla component. In order to gauge the progress, I wanted to make a progress bar using ajax and javascript as the request is ...
1
vote
2answers
918 views

How positioning the calendar popup?

I am programming a component that contains a modal window. In the modal window, there is a calendar field. <?php echo JHTML::_('calendar', null, 'birthdate', 'birthdate'); ?> The position ...
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 ...
0
votes
1answer
291 views

Can't clear a cache of Joomla module

I created some Joomla module for my client and he installed it in his backend. After a while I made some edits in the module and my client reinstalled it but my edits don't apply on his website (...
2
votes
1answer
626 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 ...
2
votes
1answer
37 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 ...
4
votes
3answers
576 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 ...
0
votes
1answer
77 views

How do I migrate AJAX interface from 1.5 to 3.x for mobile App

I'm updating a website selling online services that has a complimentary App acting as a mobile front end to the Joomla v1.5 CMS. The App communicates via a component (com_mobile) using JSON data ...
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 ...
1
vote
1answer
88 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
106 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.
4
votes
1answer
1k views

Joomla 3.4 login api - how to “remember” session

This works great for 3.4 Joomla. How do I keep the user logged in? i.e. "remember"? JPluginHelper::importPlugin('user'); $options = array(); $options['action'] = 'core.login.site'; $response->...
1
vote
2answers
44 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
93 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
770 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(...
6
votes
1answer
427 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::...
2
votes
1answer
49 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
31 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()->...
2
votes
1answer
5k views

Get menu item by ID in Joomla 3

How do I get a menu item by ID in Joomla 3? While converting a site from Joomla 1.5 to Joomla 3, I encountered this code $mainframe = JFactory::getApplication(); $menu = $mainframe->getMenu('...
0
votes
2answers
4k views

How to override/customize pagination links?

In my component, I am using Joomla default pagination calling $this->pagination->getPagesLinks() in the view template file. Say, my component url is like this at a certain point: http://...
1
vote
1answer
133 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
66 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 = ...
11
votes
2answers
9k views

Catching exception/error in database transaction

I am using the following way in joomla 2.5 and 3 to execute database query - $database = JFactory::getDBO(); $database->setQuery $database->execute(); but how do I catch errors/exceptions if ...
1
vote
0answers
416 views

Create breadcrumbs when JPathway object is empty and knowing the parent JMenu

There may be a couple of ways to solve this, but it seems the JPathway/JMenu route is the most feasible. I have legacy php code that is pulling design information from a database. The custom code ...
2
votes
1answer
2k views

Does anyone know where JFactory::getApplication()->getParams() is declared?

I'm working on my MVSC implementation. I'm planning on adding a function called getParams() to my base view, so that I don't have to keep merging item, menu, and component params before rendering the ...
4
votes
2answers
2k views

Jform POST issues

I have a form that needs to post to another form (which is an outside form). I have the 1st form set up with the action to the url and method post. However, it is using JForm. It is working fine on ...
0
votes
1answer
68 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 ...
1
vote
1answer
96 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
13
votes
3answers
9k views

How to check what component is being used on current page?

I want to set up my template so it will display different layout depending on what component is being used on current page. How to check for this?
1
vote
3answers
133 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
3
votes
1answer
79 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 ...