6

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::getApplication(); $app->setUserState('com_mycomponent.view.filter.variable' ,'new state'); $variable = $app->getUserState('com_mycomponent.view.filter....


5

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 your custom module chrome either by specifying it in index.php of your template or within the module settings.


5

Found it! Source of joomla chrome styles can be found in: /templates/system/html/modules.php


5

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 happens on the articles. This enables you to run content plugins (e.g. loadModule, email cloaking, etc) in your custom html modules. I guess that the answer ...


4

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 plugin. You have to use it like so: JPluginHelper::importPlugin('captcha'); $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('onInit','...


4

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() > 0) { ob_end_clean(); } // Start capturing output into a buffer ob_start(); // Content to export echo $toExport; // Get ...


4

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"> <input type="hidden" name="option" value="com_ajax"> <?php // Module name without mod_ prefix ?> <input type="hidden" name="module" ...


4

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 either import it: use Joomla\CMS\HTML\HTMLHelper; HTMLHelper::doSomething(); HTMLHelper::doSomethingElse(); Or use fully qualified class name: \Joomla\CMS\...


3

You can use the following to display the desired message: $app = JFactory::getApplication(); exist $menu = $app->getMenu(); $title = $menu->getActive()->title; echo 'Welcome to ' . $title;


3

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->server->get('HTTP_X_FORWARDED_FOR',''); returns the correct value for the user ip address when the server is proxied!


3

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: $session = JFactory::getSession(); $session->get('favcolor');


3

In the simplest form as you have described in your question, saying that you are just want to display content from the current user in a module, it is possible that some modules would have already such filter settings (that will use the current user id and retrieve/display their articles in the front-end). You can look in JED for article modules and check ...


3

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 file. <filename plugin="myplugin">myplugin.php</filename> Example: <files> <filename plugin="myplugin">myplugin.php</filename&...


3

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 for mod_tags_popular module's layout strings: MOD_TAGS_POPULAR_LAYOUT_CLOUD="Cloud" MOD_TAGS_POPULAR_LAYOUT_DEFAULT="Default" The language key for module ...


3

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 find a list of icons and their codes at: https://fontawesome.com/cheatsheet


3

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 extremely easy way to access them! You can give the elements in your module instances unique ids by doing something like <div class="my-module-container" ...


2

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 plugins that you could use within content, simple modules or more sophisticated modules, or whole components that allow you to manage the images and have them ...


2

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 = $db->getQuery(true); $query->select($db->quoteName(array('a.Nombre','a.Email','a.Pais','a.Google','a.Skype','a.Password'))) ->from(...


2

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 your code around {source} tags like so: {source} <?php echo " Hello World" . "\n"; ?> {/source}


2

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 pass them... If your button could submit a form that would do the trick, but as I understand it is not possible for custom buttons.


2

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 like below: <a class="modal" href="index.php?option=com_users&view=profile&layout=edit&tmpl=component?" rel="{handler: 'iframe', size: {x: 640, y:...


2

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 html, js, and css. Enter this code into the custom code box: <?php JHtml::_('behavior.formvalidation'); $JInput = JFactory::getApplication()->input; $...


2

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 <input type="text" name="container[fallBeginning]" value="x"> The container value depends on your xml definition, what is the name of fields. For example &...


2

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->get('catid', array())); try to change that line to this: // Category filter $model->setState('filter.category_id', $params->get('catid', '')); The ...


2

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 them, like so: $match_id = $input->get('match_id', null, 'RAW'); $match_time = $input->get('match_time', null, 'RAW'); $match_venue ...


2

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 will display as heading? At the other hand, there is no such thing as $list->displayCategoryLink; Anyway, in the case you show articles from 1 only category, ...


2

Under the "Options" tab for both Custom modules, set "Prepare Content" to "Yes."


2

It is because you have not set the text-filtering to "no filtering". Go to Global Configuration -> Text Filter : set the filtering for the desired type of user to "No-filtering".


2

You don't have to add separate CSS file. You can just style-up new selectors you want, or use some existing in main template.css or custom.css, whichever you are using, and reference them in Custom HTML module. That also goes along the line of general guidelines of using as small naumber of external CSS/JS files as possible, in order to reduce number of ...


2

I don't understand why you are trying to bypass the framework. I know it is resources wise but it opens you up to security risks. The other thing is that you can't use framework classes/functions as easily. What I would do is: Instead of using a direct URL to the module file, use current URI (JURI::current() as far as I remember). This will direct a POST ...


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