8
votes
Accepted
How to get module parameters inside helper function and how to get params inside a custom form field type?
1. How to get Modules parameters inside Helper Function
You are going all wrong with this.
First, you can't use $this inside a static method, because they are independent of any instantiated object. ...
7
votes
How to get module parameters inside helper function and how to get params inside a custom form field type?
I much prefer going for the OOP approach. This is what I use in one of my extensions. It's Ajax based so I have a separate function to get the parameters.
helper.php:
class ModSomethingHelper
{
...
7
votes
Accepted
How can I make a site like StackExchange with Joomla?
Theres a whole Questions and Answers category in the JED including:
JE Stack Exchange (free)
JE Stack Exchange Pro (paid)
Minitek Discussions Pro (paid)
which seem to have the basic functionality of ...
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 ...
6
votes
Output of modules
The function is extremely handy when your template has some complex grid flexibility. Lets take the following into consideration:
You have a template with a 12 column grid.
_________________________
...
6
votes
Accepted
How to add CSS/JS/an Image to a module backend
I personally do this in my extensions by creating a custom field:
XML:
<fieldset name="something" label="Something" addfieldpath="/modules/mod_xxx/fields">
<field type="testfield" />
...
6
votes
Accepted
Create a table observer
This was working ok on my instance Joomla 3.9.22 with PHP 7.3.5 (and mysql). Then to test this I selected PHP 7.0.33 instead and it gave me an error:
Fatal error: Declaration of MyObserver::...
5
votes
Accepted
Template module names based on position
If you mean programatically, JModuleHelper should return the info you need.
$modules = JModuleHelper::getModules('position-1');
print_r($modules);
5
votes
Remove /component/ from URL generated from module for a custom component
The /component/name/ part of the url is automatically written by Joomla router when there is no matching menu item found. This is required for the application to route the command to the proper ...
5
votes
Accepted
Can Smart Search index menu items or custom modules?
To answer the question: The items indexed in the smart search are driven by the 'finder' plugins. Menu items and custom modules have no finder plugins, but you could write them. I don't know of any ...
5
votes
Generate and render a module on an article with PHP
A bit confusing your questions as is, especially when you say you can add it to the article using php, but then that you can't figure out how to add it...
If I am getting you right, you want to ...
4
votes
How to get module parameters inside helper function and how to get params inside a custom form field type?
Your main module file and template file will have $params variable created by Joomla! core.
If you have static methods, then pass that variable to function call:
class ModTestHelper
{
public ...
4
votes
Available fields in Joomla XML manifest
There is also one other neat trick - when using Radio buttons, you can add Bootstrap class and they will look nicer. Look for class attribute in this code:
<field name="some-choices" type="radio" ...
4
votes
Accepted
Publish/Unpublish module on a schedule
You definitely have to look at Regular Labs: Advanced Module Manager Pro
The pro version features Seasons, Months, Days, Time assignments, so you can schedule the appearance of your modules.
4
votes
Accepted
How do I get a watermark on a sigplus gallery?
I thought I had already done this before I posted but I tried again and got positive results
So after looking at a post about a supposed bug with an earlier version of the plugin there was a couple ...
4
votes
Accepted
Class not found in Joomla 4 when using JDate inside a function
I’m answering the question because it is obviously not a Joomla 4 core bug but a mistake in the developer’s coding and the problem would be the same in Joomla 3 too.
If you try to use a Joomla core ...
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 ...
4
votes
Accepted
How to overwrite a module's .php to control what scripts it adds to the head of the doc?
module_name.php file can't be overridden.
Check to see if the module has options to disable the loading of its scripts - Many modules come with such settings.
If it hasn't, then you could propose ...
4
votes
Accepted
Unable to deploy updateserver for site module
You have to add a client element in your updater xml:
<client>site</client>
Joomla seems to take the admin as the default.
I tried out your xml and found that joomla was indeed finding ...
4
votes
Randomly render one of the modules in a given position
Have a look at the Module Helper documentation.
getModules(): Get modules by position
getModules(string $position) : array static
since 1.5
Arguments
$position string The position of the module
...
4
votes
Module title is not showing despite setting module title to yes
You are using a Gantry template, which likely has pre-defined module positions.
In the Hydrogen template that you're using, the module position will be getting called like this:
<jdoc:include type=&...
4
votes
Recommend a contact us module for Joomla 3
Most form extensions would be sufficient for this job.
For example with RSForm (paid extension), you can build almost any kind of forms and render them as a module, using the RSForm module in any ...
4
votes
Adding ajax call in a module for Joomla 4
To use J4 style or custom naming conventions with AJAX you have to convert the module to new service-based format. At a minimum, service provider (services/provider.php) needs to provide a module ...
3
votes
Accepted
Module coming on all pages
I recommend you to do this:
Create a menu called: Hidden Menu
Do not assign this menu to any menu module
Create a menu element for each of the links you want to display in home page
That way, they ...
3
votes
Add <script> tag before </body> on only certain pages?
If you have access to your template, you can use the following code
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', ''...
3
votes
Calendar Field Type
I would guess there's an implicit timezone conversion happening. It's saving the time as midnight GMT in the DB, but on re-display, it's converting it to local time.
3
votes
Accepted
Custom field colResizable plugin not working but works in fiddle
You are calling the colResizable jQuery plugin before the jQuery itself. It should be the other way round.
Also, Joomla's admin should also already have jQuery loaded, but that uses jQuery v1.12.4. ...
3
votes
Accepted
Dynamic fields in module parameters
No answers here, but I have managed to work it out for myself. The answer is actually to use both of the solutions I had in mind already -- a custom field type and a subform.
My solution works like ...
3
votes
Accepted
How can I show the Published date of the current article inside a module?
The following should work for what it sounds like you are trying to achieve. If you are on an article page, it displays the published date of that article or else shows nothing.
// FIRSTLY CHECK ...
3
votes
Accepted
Loop Joomla Modules
Well from your description I can't figure out for 100% what you trying to accomplish.
But my thoughts is you need to simplify code in index.php (remove "block-cobtent") and move it to html/modules....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
module × 440joomla-3.x × 142
php × 46
component × 36
module-display × 35
plugin × 32
joomla-2.5 × 31
module-params × 29
articles × 27
custom-module × 27
development × 26
extensions × 26
templates × 20
ajax × 20
menu × 19
joomla-3.4 × 18
overrides × 18
jquery × 13
template-override × 13
javascript × 12
administrator × 12
custom-field × 12
css × 11
joomla-api × 11
database × 11