7 votes

What does "Prepare Content" do and when should it be used?

Prepare Content will enable the onContentPrepare plugins event for the content of the module. So the custom html module's html content will go through the process of content plugins, similar to what ...
user avatar
  • 19.5k
6 votes

Joomla access state variable in modules

Your code is correct - I have tested it on a custom module myself, in Joomla 3. Please make sure you have cookies enabled. Try this in your module, and you will see that it works: $app = JFactory::...
user avatar
  • 161
5 votes

Where can I find source for Joomla chrome templates?

To override those defaults you just need to place a file called modules.php in a folder called html in your template, e.g.: /templates/[your default template]/html/modules.php. Then you can apply ...
user avatar
5 votes

Where can I find source for Joomla chrome templates?

Found it! Source of joomla chrome styles can be found in: /templates/system/html/modules.php
user avatar
  • 301
5 votes
Accepted

How to create a custom script to force the download of a .csv file that is generated in real time?

If this needs to be done by the module (there's no accompanying component or the component is 3rd party and you can't touch it), use com_ajax. Point the form to com_ajax: <form method="post"> ...
user avatar
  • 8,491
5 votes
Accepted

How to use HTMLHelper to add to the document head

1) JHtml is an alias for Joomla\CMS\HTML\HTMLHelper class. You'll have to start using the real class sooner or later because the alias will not exist in Joomla! 5.0. To use the real class you have to ...
user avatar
  • 8,491
4 votes

How can I use google recaptcha in my custom page?

First read carefully in which files the SO answer that you quoted tells you to put the code. Also, the code you attached is no longer working in Joomla 3.5. This is due to a change in the reCaptcha ...
user avatar
  • 725
4 votes

How to create a custom script to force the download of a .csv file that is generated in real time?

Regarding clearing the output buffer, some time ago I had a similar issue and this solved the issue, at least for me: // Close output buffers till the level reaches 0 while (ob_get_level() &...
user avatar
  • 871
4 votes

Getting CSS style to vary with different module instances

I figured out my problems, so I thought I would answer my own question. 1) Different styling for different instances of the same module Don't forget Joomla has unique module ids! And there's an ...
user avatar
  • 299
3 votes

Getting wrong IP address from JFactory::getApplication()->input->server->get('REMOTE_ADDR','');

Maybe bad form to answer my own post, but I did locate the answer once I moved beyond the Joomla documentation. In my situation, the following line: $clientip = JFactory::getApplication()->input-...
user avatar
  • 61
3 votes
Accepted

Passing variables between a PHP module and a PHP script

You shouldn't use using $_SESSION with Joomla, but instead JFactory::getSession(). Try the following: Module: $session = JFactory::getSession(); $session->set('favcolor', 'green'); PHP file: $...
user avatar
  • 26.5k
3 votes
Accepted

How to detect whether the user is on a specific menu?

You can use the following to display the desired message: $app = JFactory::getApplication(); exist $menu = $app->getMenu(); $title = $menu->getActive()->title; echo 'Welcome to ' . $...
user avatar
  • 26.5k
3 votes
Accepted

Get user info and send email from button

Download Flexi Custom Code Module from the JED. Install the module and publish it to the position of your choice. Below the custom code box leave the option to use PHP on and disable the cleanup of ...
user avatar
  • 1,737
3 votes
Accepted

Debug custom plugin error

The error you get mentions the obvious. That in your xml file you haven't specified the plugin.php file. Make sure you have included the correct php file of the plugin in the files section of the xml ...
user avatar
  • 19.5k
3 votes
Accepted

Module Template/alternate layout Name language Override

The layout language key is built like this: $key = strtoupper($module . '_LAYOUT_' . $value); Where $module is the module name (including mod_ prefix) and $value is the layout name. Example string ...
user avatar
  • 8,491
3 votes

How to style a module or article title with font awesome icons?

You could add some custom CSS like this or similar: .page-class .page-header h1::before { font-family: FontAwesome; content: "\f095"; } Use a page class to target a specific page. You can ...
user avatar
3 votes

How to create a custom script to force the download of a .csv file that is generated in real time?

It turned out that using @n.h.'s nifty output buffer cleansing workaround was not necessary after implementing @Sharky's advice regarding com_ajax and getAjax(). So that researchers will be able to ...
user avatar
  • 4,448
3 votes
Accepted

Use addScriptOptions for multiple modules on same page

A simple code review: You don't need the condition block because getScriptOptions() always returns an array. getScriptOptions() documentation If you want to declare the variable $configs... $configs = ...
user avatar
  • 4,448
3 votes

How to build a podcasting site?

A podcast is just another form of content in a file therefore yes you can and the second part of your idea is going to need some form or subscription/payment process. A quick Google and this article ...
user avatar
  • 2,240
3 votes

Show 'menuitem' field name in frontend of module

You can use the following: $menu = Joomla\CMS\Factory::getApplication()->getMenu(); $menuItem = $menu->getItem($menulink); echo $menuItem->title; If you var_dump($menuItem);, it will show ...
user avatar
  • 26.5k
2 votes
Accepted

Custom Admin Panel/Back-End Functionality Starting Point

This one is one of the most common requirements in almost every website. There are plenty of ready made solutions that accomplish this in a variety of ways for Joomla. Solutions exist from simple ...
user avatar
  • 19.5k
2 votes
Accepted

Problems with sourcerer and a table

The problem being is that you are echoing a full table foreach result. Have a look at this updated code and let me know what the outcome is: {source} <?php $db = JFactory::getDbo(); $query ...
user avatar
  • 26.5k
2 votes
Accepted

Inserting php in a custom html module

By default, Joomla doesn't allow you to use PHP in the editor. You will need to download a 3rd party extension to allow this feature. I would strongly recommend Sourcerer. Once installed, simply wrap ...
user avatar
  • 26.5k
2 votes

How to pass, with a custom button, the selected items to a controller?

Your button invokes only GET action. That means all input fields are not processed, but selected items are input fields. See the same problem in this question. Honestly I do not see any way how to ...
user avatar
  • 4,045
2 votes
Accepted

Display and edit user profie in a custom componet

Just an idea for a quick implementation: You could add a modal link to the com_users edit profile view in your component's view. At the top of your view add: JHTML::_('behavior.modal'); Then link ...
user avatar
  • 19.5k
2 votes

Unable to insert form values in to database Joomla 3

Just a little to expand on @Sahil Purav's answer. The reason why your values might not be being stored as they should is because you need to define a filter in your inputs. Try adding RAW to all of ...
user avatar
  • 26.5k
2 votes
Accepted

mod_articles_category Override - Adding category link outside of loop

It's not very clear what you are trying to do. This module can display articles from many categories and also works in various modes. In the case of multiple categories, what is the one that you ...
user avatar
  • 19.5k
2 votes
Accepted

How can I display a system message from a custom HTML module

A common reason for plugins not working in Custom HTML modules is that they are not processed by Joomla Content plugins by default. In order to enable this, go to the Options tab in your Custom HTML ...
user avatar
  • 13.3k
2 votes
Accepted

Calling module params from custom field type

You probably forgot to specify container of the form fields. Your code should be something like $this->form->getValue('fallBeginning', 'container') if your field has actual html code like <...
user avatar
  • 471
2 votes
Accepted

Custom self-made module doesn't show content after J3.4.3 upgrade

The problem is that you try to get items from the contacts model but the result is probably empty. Notices helper.php line 54 // Category filter $model->setState('filter.category_id', $params-&...
user avatar
  • 3,693

Only top scored, non community-wiki answers of a minimum length are eligible