[SOLVED] Image Slider changed after recent update

winchester

Member
Hi.

I'm using the File Upload element for uploading photos and the element used a image slider to view the uploaded images in list and detail. It seems that the js plugin used for that slider was changed and along with it the layout of the slider - the old one used left/right arrows to navigate the images while this new one uses thumbnail gallery below the main image. The problem is that my client prefer the older one.

Is there a way to go back to the older one or to replace it with another js plugin?

Any help will be appreciated. Thanks, in advance.
 
OK. I manged to change it back to the old (somewhat) slider style. It's a dirty fix, but in case someone else may want to do this, here's what I did.

Create Override Files
  1. Create the folders to make the following path: [WEB_ROOT]/templates/[MY_TEMPLATE_NAME]/html/layout/com_fabrik/element
  2. Copy the file fabrik-element-fileupload-slick-carousel.php from [WEB_ROOT]/plugins/fabrik_element/fileupload/layouts to the newly created element folder (above).

Editing File
Open file in text editor and then make the following changes:

1: Add the arrows by enabling it in the data-slick settings by changing from false to true
PHP:
<div id="<?php echo $d->id;?>"
     style="width:<?php echo $d->width;?>px"
     class="slickCarousel"
     data-slick='{"slidesToShow": 1, "slidesToScroll": 1, "arrows": true, "fade": true, "asNavFor": "#<?php echo $d->id . '_nav'; ?>"}'
>
    <?php foreach ($d->imgs as $img) : ?>
    <div style="opacity: 0" class="slickCarouselImage"><h3><?php echo $img ?></h3></div>
    <?php endforeach; ?>
</div>

2: Next, we going to set the data-slick settings to show only 1 slide at a time and also to remove the dots by setting it to false.

3: Next, we're going to remove the thumbnail gallery from displaying/rendering by commenting out the html and the php codes.
PHP:
<div id="<?php echo $d->id . '_nav';?>"
     style="width:<?php echo $d->width;?>px"
     class="slickCarousel"
     data-slick='{"slidesToShow": 1, "slidesToScroll": 1, "dots": false, "centerMode": true, "focusOnSelect": true, "asNavFor": "#<?php echo $d->id; ?>"}'
>
   <?php //foreach ($d->thumbs as $img) : ?>
       <!--<div><h3><?php //echo $img ?></h3></div>-->
   <?php //endforeach; ?>
</div>

4: This one may not be necessary, but I also disabled the dots by setting it to false.

PHP:
<?php else : ?>
    <div style="height: <?php echo $d->height; ?>px; width: <?php echo $d->width; ?>px" id="<?php echo $d->id;?>"
         class="slickCarousel"
         data-slick='{"slidesToShow": 1, "slidesToScroll": 1, "dots": false, "centerMode": true, "adaptiveHeight":true}'
    >
       <?php foreach ($d->thumbs as $img) : ?>
            <div style="opacity: 0" class="slickCarouselImage"><h3><?php echo $img ?></h3></div>
       <?php endforeach; ?>
    </div>
<?php endif; ?>
Note: Essentially, we added the arrows in the settings, set the navigation to show 1 slide at a time and remove the dots and remove the thumbnail gallery.[/I]

CSS Fixes
Now, lets fix the arrows so that they show properly on over the images by adding the following to your CSS file:

CSS:
/** Slider Fix **/
.slick-prev, .slick-next {z-index:9999;}
.slick-prev {left:25px !important;}
.slick-next {right:25px !important;}

There may be other CSS changes needed.
 
Thanks again Troester. I only have one issue. I'm using a tab extension on the detail pages and whenever I switch tabs and come back to the main tab with the photos, the photos disappear (including the arrows). However, the arrows links are still there, just not visible, as I can mouse over it and it is still clickable. When I do click it (anyone), the next or previous photo (depending on which one is clicked) will show. The funny thing is that one the arrows are clicked, whenever I switch tabs again and come back, it show from that point on. This issue only occurs when the detail page first loads, it seems.
 
Create Override Files
  1. Create the folders to make the following path: [WEB_ROOT]/templates/[MY_TEMPLATE_NAME]/html/layout/com_fabrik/element
  2. Copy the file fabrik-element-fileupload-slick-carousel.php from [WEB_ROOT]/plugins/fabrik_element/fileupload/layouts to the newly created element folder (above).

This is working for Detail View, but not for LIST view. Any clue ?

I tried to place in my custom list template, but no use.

/components/com_fabrik/views/list/tmpl/<yourtemplate>/layouts/element/{tablename___elementname}
 
I didn't get it working in a Fabrik list template.

You can do a general override in JROOT/layouts or in JROOT/templates/your-joomla-template/html/layouts (which will work for the list) and (if you want some other override for the details view) ...components\com_fabrik\views\details\tmpl\bootstrap\layouts\element (which then will take preference over the other one)
 
I dont know what is going wrong.

I tried to place fabrik-element-fileupload-slick-carousel.php in

  1. JROOT/templates/your-joomla-template/html/layouts
  2. JROOT/templates/your-joomla-template/html/layouts/com_fabrik
  3. JROOT/templates/your-joomla-template/html/layouts/com_fabrik/element
  4. JROOT/templates/your-joomla-template/html/layouts/com_fabrik/{tablename___elementname}
But still I cant see the result. Can you please confirm the layout of Fileupload is working for LIST or not ?

Secondly, the height value under Display Tab of Fileupload Option doesnt work.
 
I tested
  1. JROOT/templates/your-joomla-template/html/layouts
  2. JROOT/templates/your-joomla-template/html/layouts/com_fabrik
both are working for list view, so I assume /element etc will do, too.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top