Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-09-02 19:13:15

zippo
Member
From: Germany
Registered: 2018-09-01
Posts: 12
Website

Slide show quits unintentionally

I have the the following problem with the standard slideshow display:
It is very easy to click unintentionally above or below the navigation arrow, which terminates the slideshow. For the user it looks as if the slideshow has come to its natural end.
The problem occurs only on desktop. Touch devices behave perfectly: it is not possible to accidentally quit the slideshow.

Is it possible to get the same behavior on desktop as on touch devices? So that the only way of quitting the slideshow is clicking on the X-symbol?
Thank you in advance for your help!

Zippo

Offline

#2 2018-09-03 03:05:33

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 14,830
Website

Re: Slide show quits unintentionally

There is no way in the Backlight interface to do this but you can try changing the fancybox code.
Fancybox options: https://fancyapps.com/fancybox/3/docs/#options

in this case, you can try opening, in a plain text editor, the jquery.fancybox.js file found in the backlight/modules/pangolin-core/static/js/ folder (of your download).

Scroll down to lines 340 and 343. Chances are you'll want to change both of the values to false (looks like you shouldn't put quotes around false). See the possible values starting at line 326 above that.

Save the file and re-upload it to the server.

In Backlight, clear template cache.

I've not tested this yet so no guarantees. There may be unintended consequences since Fancybox is used throughout Backlight for more than just the album slide show (it's used for Cart and Client Response pop-ups as well as user created pop-ups. Probably other things as well.)

When saving the file, I suggests saving it to a different folder on your compute so that the original file stays intact in case something goes sideways and you have to re-upload it.

You'll also need to upload the saved file again after any Backlight updates.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Offline

#3 2018-09-03 07:02:29

Matthew
Administrator
From: Seoul, South Korea
Registered: 2012-09-24
Posts: 5,390
Website

Re: Slide show quits unintentionally

Slightly easier, perhaps. For any option not explicitly set by our gallery configuration, you can provide your own default. For example:

<script>
$.fancybox.defaults.clickOutside = false;
</script>

You'd want to add this using PHPlugins' ttg_scripts location.


Campagna Pictures, http://campagnapictures.com
The Turning Gate, http://theturninggate.net

Offline

#4 2018-09-03 07:32:17

zippo
Member
From: Germany
Registered: 2018-09-01
Posts: 12
Website

Re: Slide show quits unintentionally

function ttg_scripts( $style, $path ) { 
	echo '<script>$.fancybox.defaults.clickSlide = false;</script>
	';
	echo '<script>$.fancybox.defaults.clickOutside = false;</script>
	';	
}  

is working perfectly!
Thank you all very much for your help!!

Zippo

Last edited by zippo (2018-09-03 08:22:09)

Offline

#5 2018-09-05 08:05:24

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 983
Website

Re: Slide show quits unintentionally

zippo wrote:
function ttg_scripts( $style, $path ) { 
	echo '<script>$.fancybox.defaults.clickSlide = false;</script>
	';
	echo '<script>$.fancybox.defaults.clickOutside = false;</script>
	';	
}  

is working perfectly!
Thank you all very much for your help!!

Zippo

That's a good one to remember!


Daniel Leu | Photography   
DanielLeu.com

Offline

#6 2018-09-07 00:19:31

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

I am also not liking the slideshow quit function when you miss the 'next' arrow.

It's been a while since I customized. Once I add the function to the custom plugins.php file, how is that 'called' by the slideshow?

Offline

#7 2018-09-07 00:25:47

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

The content of my php file is this. Maybe I am not doing it right...:


function ttg_scripts( $style, $path ) {   
echo'

<script>$.fancybox.defaults.clickSlide = false;</script>
<script>$.fancybox.defaults.clickOutside = false;</script>

<script type="text/javascript">
var sc_project=7247521;
var sc_invisible=1;
var sc_security="8a4441b8";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="hit counter"
href="http://statcounter.com/" target="_blank"><img
class="statcounter"
src="//c.statcounter.com/7247521/0/8a4441b8/1/" alt="hit
counter"></a></div></noscript>
';
    }    //END

Offline

#8 2018-09-07 02:07:16

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 983
Website

Re: Slide show quits unintentionally

Peter, you use single quotes inside echo '....';. This causes an error. All these internal single quotes need to be escaped by a backslash. More about this at http://community.theturninggate.net/vie … hp?id=5116

At first, I would remove your statcounter (this is where the errors are) to verify that slideshow works as expected. Then you can put this code back in and replace ' with \'.


Daniel Leu | Photography   
DanielLeu.com

Offline

#9 2018-09-07 02:17:44

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

Thanks - I'll try that. I had visited the single quote issue before but can't remember the outcome. Statcounter does work though.

Offline

#10 2018-09-07 02:24:14

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

So if I just use the following, I still get an exit from the slideshow when I click to the side of the /next' arrow.

function ttg_scripts( $style, $path ) {
    echo '<script>$.fancybox.defaults.clickSlide = false;</script>
    ';
    echo '<script>$.fancybox.defaults.clickOutside = false;</script>
    ';   

This eg. also has ' inside the echo...?

Offline

#11 2018-09-07 02:26:52

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

I also tried this: (doesn't work either)
I do clear template cache each time - should I clear browser cache too?
(Thanks!)

function ttg_scripts( $style, $path ) {
<script>
$.fancybox.defaults.clickOutside = false;
</script>
}

Offline

#12 2018-09-07 02:52:01

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

Hi Daniel,

Re. quotes inside echo command, I see the proper way now.

I misread your info - I thought it was quotes after echo, not between echo' and '
smile

But since my code is now simplified (for trial purposes) I can't get it to work yet.
I will make sure that the correct php file is being called (just have to find where that config setting is).

Peter
This is my current content:

function ttg_scripts( $style, $path ) {
<script>
$.fancybox.defaults.clickOutside = false;
</script>
}

Last edited by peter (2018-09-07 02:54:32)

Offline

#13 2018-09-07 03:06:24

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

I see what the problem is. I am not calling the correct file from my design template. It's been a long time since design changes, so it's slowly coming back to me...

Offline

#14 2018-09-07 03:14:22

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

Ok, got it working - that was the problem.
Apologies for the multiple posts...

I also referenced an old Statcounter code, which I had fixed up with \'
This is my final code that works as expected.
Thank you Zippo, Daniel, Rod & Matt. You guys rock!

function ttg_scripts( $style, $path ) {   
    echo'
    <script type="text/javascript">
document.write(\'<div>\');
var sc_project=7247521;
var sc_invisible=1;
var sc_security="8a4441b8";
var scJsHost = "http://www.";
document.write("<sc"+"ript type=\'text/javascript\' src=\'" + scJsHost + "statcounter.com/counter/counter.js\'></"+"script>");
document.write(\'</div>\');
</script>
';


echo '<script>$.fancybox.defaults.clickSlide = false;</script>
';
echo '<script>$.fancybox.defaults.clickOutside = false;</script>
';
    }

Offline

#15 2018-09-07 03:28:41

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 983
Website

Re: Slide show quits unintentionally

smile


Daniel Leu | Photography   
DanielLeu.com

Offline

#16 2018-09-07 04:07:20

Matthew
Administrator
From: Seoul, South Korea
Registered: 2012-09-24
Posts: 5,390
Website

Re: Slide show quits unintentionally

Cool. If you'd like, you can clean things up slightly in this way:

echo '
	<script>
		$.fancybox.defaults.clickSlide = false;
		$.fancybox.defaults.clickOutside = false;
	</script>
';

Not a big deal either way.


Campagna Pictures, http://campagnapictures.com
The Turning Gate, http://theturninggate.net

Offline

#17 2018-09-07 04:11:59

peter
Member
Registered: 2012-09-26
Posts: 271

Re: Slide show quits unintentionally

I'm all for that!
Thanks again.

It's funny, I asked my wife if she finds that sometimes clicking on the next arrow takes you back to the gallery. She said 'yes', so she's happier now too!

Offline

Board footer

Powered by FluxBB