Hot answers tagged

11 votes
Accepted

How to conditionally show fields in module xml?

You can use Joomla's showon attribute in your field. Here's an exmaple: <field name="first" type="list" label="Select Something"> <option value="1">Option 1</option> <...
Lodder's user avatar
  • 26.9k
6 votes
Accepted

How do I override a Joomla XML?

I bow down to @Lodder experience and assume you cannot overcome this issue by overriding the XML. However, you still have two options: Either edit the original XML file Although, there may be reasons ...
Eoin's user avatar
  • 1,889
4 votes

Populate multi select data into the custom list field of form inside user management

You are doing it completely wrong. Never make core changes to files/classes because there are big chances that you will lose everything on the next CMS update. Instead use plugins. It is the best way ...
Dmitrijs Rekuns's user avatar
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" ...
Vladimir Jovanović's user avatar
3 votes
Accepted

XML form related fields

Have you tried to use Subform field?. It allows you to nest XML forms inside each other or reuse your existing forms inside your current form. And your need, you can combine it with showon attribute.
webchun's user avatar
  • 2,418
3 votes

What is wrong with this XML Package Installation file? Joomla cant find XML on Package

Ok, I discovered what the issue was.. It was just something very silly. The issue was that the XML on the pkg starts with: <?xml version="1.0" encoding="UTF-8" ?> And the XML on one of the ...
user1967509's user avatar
3 votes
Accepted

Dynamically add option to Jform field

You're already aware of Joomla\CMS\Form\Field\ListField::addOption() method. value is an attribute in the XML so it needs to be passed along with other attributes in the second argument: $this->...
Sharky's user avatar
  • 10.9k
2 votes
Accepted

How to not overwrite specific file when installing extension update

Thought I'd expand on my comment. You're firstly going to need to add an install-uninstall-update script file to your component. Have a read of the Joomla Documentation on how to do this. Once you ...
Lodder's user avatar
  • 26.9k
2 votes

How to define Array in XML field - Joomla

Sadly, this is not how it works in Joomla. Your fields have to have unique names. If you only have these 3 fields, I would suggest to name your fields s1img_1, imgSetting_1, s1img_2, ... This will ...
fruppel's user avatar
  • 3,723
2 votes
Accepted

What is wrong with this XML Package Installation file? Joomla cant find XML on Package

I've tested with your code, and it works for me. To try and isolate the bug, I'd probably firstly remove the <files> node and the packages folder and see if you get a Package Update: There were ...
RichardB's user avatar
  • 3,072
2 votes
Accepted

Issues updating from Joomla 3.4.8 to 3.6.5

We don't have the full information and historical of your site and it's not clear if the update you have is prior to any update attempts. Also, it's not clear if any of your issues existed before your ...
FFrewin's user avatar
  • 19.6k
2 votes
Accepted

Pulling XML parameter to PHP file

Firstly, you should always use a single string for the name attribute. If there are multiple words, it's best to separate with with an underscore and always ensure all characters are lowercase to ...
Lodder's user avatar
  • 26.9k
2 votes

XML file does not upload with my custom module

The manifest (main xml) is the only file that doesn't need to be included in the manifest (ie itself). Other xml files need to be listed either as files or be in listed folders. One attribute in the ...
jamesgarrett's user avatar
  • 3,299
2 votes
Accepted

How do I override an .xml file in a Joomla component?

You should check Joomla Plugins and Events. There are such events like onContentPrepareForm($form, $data) and (may be you'll want to use onContentPrepareData($context, $data) but you should be fine ...
Alexandr's user avatar
  • 1,130
2 votes
Accepted

Crawling Joomla websites without parsing website's html

Joomla! 4.0 will have Web Services. In 3.x, without using extensions or custom code, there's no way to do this for single articles. For article listings (category views) you could use RSS/Atom feed ...
Sharky's user avatar
  • 10.9k
2 votes
Accepted

Add text and link to fieldset in config.xml

You could try the "spacer" field type and see if that's good enough for your purposes: <field name="example_spacer" type="spacer" label="Text you want here" /> Then put it in your XML file ...
Arlen's user avatar
  • 802
2 votes

Dynamically removing single JForm option

Another option could be to place the two versions of the field in separate .xml files in your /forms folder and then decide which one to load. If ($option == 1) { $form->loadFile('...
Irata's user avatar
  • 3,597
2 votes

Dynamically removing single JForm option

So this is what I've done: protected function preprocessForm(JForm $form, $data, $group = '') { $app = JFactory::getApplication(); ... if ($app->isClient('site')) { // ...
Mike's user avatar
  • 341
2 votes

Dynamically removing single JForm option

The small problem with your question is that <option> is not a field attribute but an element in XML, so you cannot set or remove that using methods for field attributes. You can remove however ...
Zollie's user avatar
  • 2,896
2 votes

How to enable or disable plugins from manifest file?

In order for this to work properly you would use enable="true" to enable the plugin and disable="true" to disable the plugin.
Scott Smith's user avatar
2 votes
Accepted

subform inside subform in module

Access the link fields the same way you're accessing other fields, through the main activities field. <?php foreach ((array) $activities as $activity) : ?> <?php foreach ((array) $...
Sharky's user avatar
  • 10.9k
2 votes
Accepted

HTMLHelper call a custom class in a module

You need to register the HTML services with the service registry. If your component uses the same convention as Joomla core, then the services are registered during the boot up process of the ...
Sharky's user avatar
  • 10.9k
2 votes

Can the package XML be accessed from the preflight method?

Yes, you can. The preflight method has two parameters, and you can, for example, obtain the current version being installed with: function preflight($type, $parent) { $version = (string) $parent-&...
mbrampton's user avatar
  • 314
2 votes
Accepted

use file or filename in XML

Each file to copy must be represented by a <filename> element. If you want to copy an entire folder at once, you can define it as a <folder>. Useful resource to consult: https://docs....
Carlitorweb's user avatar
2 votes
Accepted

Get the form fields as defined in the form xml file

There is Joomla\CMS\Form\Form::getFieldset() method for returning an array of fields belonging to a fieldset as Joomla\CMS\Form\FormField objects. $fieldNames = []; foreach ($form->getFieldset('...
Sharky's user avatar
  • 10.9k
1 vote
Accepted

Using a different id name for Joomla forms

Most form views in core components have custom Joomla.submitbutton() functions. Standard function does indeed support only adminForm as form ID. Instead you can use Joomla.submitform() and pass your ...
Sharky's user avatar
  • 10.9k
1 vote

How to use 'showon' with global settings in menu item parameter?

The interesting bit here, I think, is that the "Use Global" option leaves the field empty so this simple approach will work for you, but only as long as the global value is 0: showon="...
Arlen's user avatar
  • 802
1 vote

Creating a multidimensional JForm field dynamicaly

I found a solution that seams to work. Creating the Form without the usual jform control class like this: // $form = $this->loadForm('my_comp.examplegroup', 'examplegroup', array('control' => '...
Mike's user avatar
  • 341
1 vote
Accepted

Joomla 404 component not found (custom component)

From your question it is ambiguous whether your entry file is inside the admin subfolder or not. It should be in the com_administratie folder if it isn't. Also your xml files declaration looks odd: ...
jamesgarrett's user avatar
  • 3,299
1 vote

Crawling Joomla websites without parsing website's html

Joomla 3 There are a few existing places to get an API for Joomla! 3. https://techjoomla.com/rest-api-for-joomla https://www.selfget.com/products/jbackend.html Joomla 4 Or in Joomla! 4 is a full API ...
Eoin's user avatar
  • 1,889

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