Hot answers tagged

7

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->slideshow_img; ?>" /> <p class="slideshow_text"> <?php echo $item->slideshow_text; ?> </p> </div> <?php ...


4

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 component folder (site or admin) as the XML file, and put your layout in it: -com_myComponent - controllers - layouts - mylayout.php - models ...


3

By breaking up the files into multiple subforms you can use showon. Here is what I ended up with. Main Subform <?xml version="1.0" encoding="UTF-8"?> <form> <fieldset name="image-fieldset"> <field name="media_manager_or_url" type="list" label="MOD_KOU_BACKGROUND_IMAGE_WITH_TEXT_MEDIA_MANAGER_OR_URL_LABEL" ...


3

When you need to get just one field names' value: use Joomla\Utilities\ArrayHelper; $items = ArrayHelper::getColumn((array) $params->get('subformName'), 'fieldName');


3

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->slideshow_items); ?> <?php foreach ($slideshow_items as $item) : ?> <div class="slideshow"> <img src="<?php echo $item->slideshow_img; ?>" /&...


3

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

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= "Field name description" type= "subform" label= "Field Label" required= "true" formsource= "/administrator/components/com_mycomponent/models/forms/...


2

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.jquery.com/topic/should-chk-prop-checked-true-trigger-change-event


2

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 implemented. Just add the following line to the beginning of your corresponding table class. With this information the bind method of the Joomla core table class ...


1

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 uses Table API, you can add support for JSON encoded fields by declaring $_jsonEncode class property in the table class: class MyTable extends JTable { ...


1

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 programming it into the template override for the view by looking at the ID for the item and then transpose the object array into a temporary array with the desired ...


1

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 will need to be a custom field obviously. I would suggest storing it in the database as a json string, with the key being the column name and the value being ...


1

$repeatable_fields_map = (array)$this->params->get('repeatable_fields_map'); foreach($repeatable_fields_map as $item) { $accreditationImage = $item->accreditationImage; $accreditationText = $item->accreditationText; $link = $item->link; // do stuff with these variables }


1

I don't think this is possible out of the box. Maybe you can create your own JFormField which creates wrapper around the subform.


1

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"> <?php foreach ($slideshow_items as $item => $value) :?> <div class="item<?php echo ($item=='slideshow_items0') ? ' active': ''; ?>"> ...


1

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 be found here: https://github.com/joomla/joomla-cms/issues/11551 In the meanwhile the only possible solution is to add your own javascript and copy the values ...


1

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 text form field. This is the field that you load to get the results for C. When the user hasn't selected anything it shows the word character in the select box....


1

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 broken data. Not to mention that creating and testing a proper query would take ages. Solution What I would recommend is to do it through CLI Joomla! application. ...


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