7
votes
Accepted
How to get value from Sub Form
This is my solution. If there's any better solution please let me know
<?php foreach ($slideshow_items as $item) : ?>
<div class="slideshow">
<img src="<?php echo $item->...
5
votes
Accepted
How to use Subform in nested Subforms
The reason this doesn't work is because Joomla! does not know which showon to use. The showon relates to the parent and not the existing file. If we then had a same named field Joomla! would not ...
4
votes
How to use a custom layout with JForm subform fields?
Edited to add subform field type-specific answer:
Having looked at it properly, attaching your own layout to the subform field type is super-easy.
Create a layouts folder in the same parent ...
3
votes
Layout override for repeatable subform custom field
This helped me to solve my problem...
<?php $fieldX = json_decode($this->item->jcfields[X]->rawvalue, true); ?>
where X is the Id of the subform native field
A, B, C is the respective ...
3
votes
How to get value from Sub Form
When you need to get just one field names' value:
use Joomla\Utilities\ArrayHelper;
$items = ArrayHelper::getColumn((array) $params->get('subformName'), 'fieldName');
3
votes
How to get value from Sub Form
Sub Form Fields data save as JSON format so first need to "json_decode()" this to get the data then run foreach look to get data.
<?php $slideshow_items= json_decode($this->item->...
3
votes
Accepted
Subform multiple data not saving
In your table's bind function, add this:
if ( ( !empty( $array[ 'list_links_url' ] ) && ( is_array( $array[ 'list_links_url' ] ) ) ) ) {
$this->_jsonEncode[] = "list_links_url";...
2
votes
Accepted
How to use a custom layout with JForm subform fields?
To place a subform (Joomla! 3.6+) within another "master" form and use a custom layout:
1) In the master JForm XML file use the subform field type.
<field name= "fieldname"
description= "...
2
votes
Subform inside modal
I don't think this is possible out of the box.
Maybe you can create your own JFormField which creates wrapper around the subform.
2
votes
Subform multiple data not saving
I know this is an old issue, but since a came across this post on my own research I would like to share my solution. Unfortunately I cannot trace back at which Joomla version this possibility was ...
2
votes
Accepted
Javascript to update input checkbox in a Joomla subform
You need to trigger the change event after changing the value of the checkbox. You can do this as follows:
$(checkbox).prop("checked", true).trigger("change");
More about this here:
https://forum....
2
votes
Straight forward code example to save and retrieve the data for a Subform?
Subform data is passed as an array. To store it in database you have to convert it to a string such as JSON. How and where to do this depends on how your component is written. But if your component ...
2
votes
Ordering subform data
Seems odd to me as to why you need to change the display ordering between the different views - would that make for an inconsistent UX?
As it looks to be a localised customisation, I’d consider ...
2
votes
Ordering subform data
Here's my suggestion, assuming I've understood you correctly.
Use a separate tab "column ordering" in the edit form to allow the admin to specify the order in which the various columns appear. This ...
1
vote
Accepted
What is the correct PHP to render Subform repeatable custom fields on the front end?
TLDR: You need to used FieldsHelper::render for that.
Here are the code samples:
fancysubform.php : the subform custom layout
Place this file there:
YOUR_JOOMLA_WEBSITE_ROOT/templates/cassiopeia/html/...
1
vote
Accepted
Create dynamic html markup from values in repeatable field json
Since your logos and urls exist in pairs, you can use a single loop over the logos and access the urls via the shared index.
Code: (Demo)
foreach ($jsonPartenaires['logo'] as $i => $logo) {
$...
1
vote
Joomla Subform adding row, the selector event is not fired if I change the value of the select element?
I got a resolution yesterday via another answer on another forum from Mark Dexter, so the credits goes to Mark!
This does the job, but I don't understand how it works. I now have an event selector in ...
1
vote
Joomla Subform adding row, the selector event is not fired if I change the value of the select element?
I ran in to a similar problem earlier this week, mainly due to the use of showon which I required to make the field required if the showon condition was met; something Joomla 3.X cannot do by default, ...
1
vote
Accepted
Own field type in subform, using with content plugin
If you're asking how to mark the value as selected in Building field, compare the list values with current value ($this->value) and add selected attribute when values match:
foreach($rows as $...
1
vote
Accepted
How do I display the values from a subform
$repeatable_fields_map = (array)$this->params->get('repeatable_fields_map');
foreach($repeatable_fields_map as $item) {
$accreditationImage = $item->accreditationImage;
$...
1
vote
How to get value from Sub Form
If you are using the Bootstrap Carousel. this works for me.
<div id="gallery-1" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<?...
1
vote
Accepted
Joomla 3.6 nested subforms not saving
So far this is not yet possible to do in Joomla. Nested subforms or in other words multi level subforms is on the agenda. It's just hoping a good volunteer is ready to tacke this issue.
More info can ...
1
vote
Accepted
use Joomla Subform field values in custom field from same module
I solved this doing it a bit different.
B is done via this code which grabs all the inputs and converts them to a select box. Then when the user makes a selection it copies that selection to a normal ...
1
vote
Joomla 3.6 How to migrate data from repeatable to subform
I don't recommend you to process this data with an SQL query. Its not bulletproof and you don't have a tools to validate the data. Why? You would have to work strictly on strings that can lead to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
subform × 25custom-field × 6
joomla-3.x × 5
joomla-3.6 × 5
repeatable-field × 5
development × 3
plugin × 2
module-params × 2
json × 2
php × 1
component × 1
module × 1
mysql × 1
custom-component × 1
jquery × 1
jform × 1
template-override × 1
form × 1
form-fields-types × 1
sql × 1
joomla-3.9 × 1
front-end × 1
layout × 1
joomla-4.x × 1
jinput × 1