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
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?
12
votes
4answers
21k views

How to display user profile information?

I want to make a custom profile page which will only display the details of the user who has logged into my website. I need to display username name registered email Is it also possible to create ...
11
votes
4answers
12k views

How to build a RESTful API with Joomla

I have been building Joomla extensions since v1 but I soon need to take an API live that I have built and have been using for a while. Currently I am using Joomla 2.5 and have written plugins for this ...
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 ...
11
votes
2answers
2k views

Return JSON using the Joomla Framework

I have started building a web application using the Joomla Framework. It consists of a simple web page which will be displayed in an iFrame along with an API that will be used to update the content ...
11
votes
2answers
1k views

Proper way to add attributes to HTML tag of Joomla page?

I am using AngularJS to add some more advanced functionality to several of my Joomla article pages. On these pages I need to add the ng-app attribute to the <HTML> tag on my page. Currently ...
10
votes
2answers
2k views

Joomla browser detection

Can we create a thorough question/answers post with the core methods that allow browser detection in Joomla 2.5 and 3 ? After a quick research in the web, I feel that there is not sufficient ...
9
votes
2answers
3k views

Joomla/PHP how to add <meta property> instead of a <meta name> tags to the the header?

Dear Joomla community, I'm working on a little system plugin to inject Facebook Open Graph properties into an article. Therefore I've been using $document->setMetaData(). But now I discovered that ...
9
votes
6answers
7k views

Adding javascript file in the footer & custom styles

For fast page load I need to insert JS at the end of the page from components and modules. The following way of declaring scripts does not work to insert it at the bottom because there is no ...
9
votes
1answer
424 views

Trash Joomla Article in frontend

I'm developing a small plugin for Joomla 3.x that adds a "Trash article" button when you're in Joomlas Frontend. See screenshot below. http://imgur.com/NYLGRdY Now I have this AJAX call that ...
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 ...
8
votes
2answers
6k views

How to redirect user with system message in Joomla 3

I know that you can achieve this by doing: JFactory::getApplication->redirect(url, message, type) but the documentation at JFactory::getApplication says it is deprecated and suggest to use ...
7
votes
1answer
336 views

Understanding mvc way of component coding for both joomla 2.5 and 3 version

I made a component in joomla 2.5 in mvc way which was not working in joomla 3, later found out it's because in joomla 3 previous mvc classes not working so is controller, view, model classes must be ...
7
votes
1answer
947 views

How to create a folder during installation custom component

I know how to create a subfolder inside the media folder by using <media folder="media" destination="com_mycom"> in the manifest file. But how to create subfolder inside of the images folder ...
7
votes
1answer
1k views

JUri::base() issue, losing subdomain

There is a chance this is a bug, but I am pretty sure I must be overlooking something. Basically JUri::base() is removing the subdomain path, this is in siteground with its Joomla staging enviroments,...
6
votes
5answers
1k views

Where to use JInput in MVC

I'm curious as to where to get data from JInput in the MVC design pattern. For example, in a situation where I need a JInput value to use in a query in a model class method, should I get the JInput ...
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 ...
6
votes
4answers
2k views

Check if module is enabled

I'm currently trying to check if a specific module is enabled by using Joomla's JModuleHelper::isEnabled(), however the problem being is that it is always returning false, despite whether it is ...
6
votes
1answer
13k views

How to get the alias or title of the active menu item?

In my template I want to give an extra class to the body of the document that will take the names of the alias of the menu item, so I can create individual styling among the pages. But how can I get ...
6
votes
1answer
7k views

How do I apply JHtmlSidebar to add a sidebar to my admin view?

I can't find any tutorials on how to use the JHtmlSidebar Utility Class. This comes close to it: Creating a toolbar for your component, but it is very vague. It mentions $this->sidebar, which ...
6
votes
2answers
5k views

What's the purpose of $this->get('Item') in Joomla view.html.php example file?

I refer to the code below, presented in Developing a MVC Component - Front End Function Example: class HelloWorldViewUpdHelloWorld extends JView { // Overwriting JView display method function ...
6
votes
3answers
683 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.
6
votes
2answers
2k views

Joomla! JFactory::getDate wrong

According to the documentation JFactory/getDate $tzOffset default value is 0. However, the following example: $date_default_offset = JFactory::getDate('now'); echo $date_default_offset->toRFC822(...
6
votes
1answer
1k views

How are the controllers for a specific view called?

I'm trying to understand how to component com_installer (the componenent for installing the extensions) in the administrator folder in joomla works under the hood. In particular, I'm trying to ...
6
votes
1answer
2k views

JInput->get() , how does it work?

I'm a beginner in Joomla and a little confused with this method. for example consider this : $app->input->get('foo',0,'int'); where is the source of foo ? JInput->get() get's inputs from ...
6
votes
1answer
388 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

Disable front-end registrators from recving a confirmation email

I'm trying to disable users that register from the front-end from receiving confirmation / welcome emails. Please note: In com_users options you can only disable the password and username from ...
6
votes
1answer
999 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 ...
5
votes
2answers
4k views

Creating an API for a Joomla extension

I need to create an API so an external client can perform actions on my custom extensions database table. What would be the right approach? Should I use https://api.joomla.org/cms-3/ for this? How?! ...
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 ...
5
votes
2answers
2k views

Two left join in one query to Joomla database

I have two tables: #__records and #__parents. In the first table some records may have parent records that are stored in the same table but relations between childs and parents are stored in the ...
5
votes
1answer
684 views

How to add a batch button in Joomla?

hello all actually I'm developing a component for school in which i want to add a batch button for asking about fail & leave fail & reappear pass & promote, pass & leave and for this i ...
5
votes
2answers
1k views

What does $context parameter of content plugin mean?

I've read that $context parameter is: "The context of the content being passed to the plugin - this is the component name and view - or name of module (e.g. com_content.article)" https://docs....
5
votes
2answers
540 views

Apply the same code on PHP to content of component and each module

I have some code on PHP something like: $oldstring = ...; ... $pattern = ...; $newstring = preg_replace_callback($pattern, ... {...}, $oldstring); echo $newstring; I need to apply this code (maybe ...
5
votes
1answer
425 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::...
4
votes
2answers
86 views

How is the Joomla Issue Tracker documentation generated?

Can anyone here share some light on how these Joomla docs were made http://issues.joomla.org/documentation/ I know that the docs are pulled from github MD files but if someone could explain the ...
4
votes
3answers
531 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 ...
4
votes
2answers
1k views

RESTful API to manage article

We have an application which collaboratively collects data from authors. We want to upload curated content to different joomla powered sites. The current application is built on Ruby on Rails. Does ...
4
votes
1answer
289 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> ...
4
votes
2answers
5k views

How to create a simple image uploader for custom component

I'm developing a custom component for creating, editing and saving data of single records including images. I know that in admin/models/forms/record.xml there must be field name="image" type="file" ...
4
votes
2answers
317 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 ...
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 ...
4
votes
1answer
61 views

How joomla plugin registers itself to a subject

Its been about a year, that i started using joomla. i.e building some plugins, module and components. Now i want to extend my level of knowledge in inside working mechanism of joomla system. I know ...
4
votes
1answer
88 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 ...
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->...
3
votes
2answers
2k views

Updating user profile

What is the code to update a user profile? This gets the user profile: $user = JFactory::getUser(); $userid = $user->id; $profile = JUserHelper::getProfile($user->id); echo print_r(...
3
votes
4answers
407 views

Can Joomla with MySql manage 500,000 users and records

I am developing a mobile which will be managed by Joomla as a backend. I am expecting about 500,000 monthly return users by 6 months after launch. What I want to know if Joomla on a shared hosting ...
3
votes
1answer
128 views

Which class method should I use for deprecated JDocumentRenderer->render();

I need to display a module in administrator side by getting the module using it's module position (see the code below). I am having error & doubt is using the code: $renderer = $document->...
3
votes
1answer
578 views

Correct way to verify if the logged in user is super user

As my question implies what i want, i used google to search through the web to get correct answer though simple about how to verify if current logged in user is super user or not in both joomla 2.5 ...
3
votes
2answers
861 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(); $...