4
votes
Get value from a repeatable field and use it in a module
The above answer from @Lodder is correct, but you will also need to wrap the function with
if (!function_exists('yourFunctionname')) {
// ... proceed to declare your function
}
If you do not, ...
4
votes
Accepted
Get value from a repeatable field and use it in a module
I was hoping someone would eventually ask this question on here. I wrote a function for my first usage of repeatable form fields and use it for every extension I make now.
Here is how you do it:
...
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
Need to dump specific table to excel
I recently answered a question regarding exporting the list of Joomla users to CSV - export user details from database via cron. The same code can be used for exporting data from any Joomla table. As ...
2
votes
Accepted
Get values of other custom fields in field layout override
Create an override of com_fields/layouts/fields/render.php. Find this line:
$content = FieldsHelper::render($context, 'field.' . $layout, array('field' => $field));
Change it to also pass the ...
2
votes
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
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
Get linear array of subform repeated values
Since PHP 7 array_column() supports passing an array of objects. You would only need to cast the data to array:
$ids = array_column((array) $this->params->get('ids'), 'id');
On older PHP ...
1
vote
Get values of other custom fields in field layout override
Here's a backstop solution, for using if no-one comes up with a better idea.
The basic approach is to use a plugin which is triggered by onContentPrepare. In this plugin it gets and processes the ...
1
vote
Accepted
Default value for repeatable custom field
So you would need to change it to be json and array based. Here is a rough example I setup as a default field which works as expected:
{"test0":{"type":"2","Fichier":"images\/joomla_black.png","...
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 ...
1
vote
Accepted
How to get repeatable form-field data?
You could group each set of field by the key.
Call the parameter and convert to array:
$social_links = $params->get('social_links');
$array_links = json_decode($social_links, true);
Create a ...
1
vote
How to update the Repeatable fields in Joomla 3 with jQuery
By default Repeatable initialised on load event, so you have time to change the value on ready event, that occurs before load event.
jQuery(document).ready(function(){
jQuery('#jform_repeatable_id')...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
repeatable-field × 14custom-field × 5
subform × 5
joomla-3.x × 2
php × 2
jform × 2
module × 1
articles × 1
mysql × 1
joomla-3.6 × 1
template-override × 1
form-fields-types × 1
sql × 1
com-content × 1
joomla-3.9 × 1
fields × 1
joomla-4 × 1
json × 1
com-fields × 1
jlayout × 1