Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-09-12 20:24:11

Rainer Goergen
Member
From: Trier, Germany
Registered: 2016-05-01
Posts: 325
Website

Phplugins

Hi, no problem with installation of BL 2.

What have I to change in this phplugin file, that it works again:

<?php function ttg_scripts( $style, $path ) {
    echo '
    <a href="#top" class="btn-scroll-to-top" title="Top of page" ><i class="fa fa-arrow-up fa-lg"></i></a>
<script>
    $(document).ready(function() {
        $(".btn-scroll-to-top").click(function() {
            $("html, body").animate({ scrollTop: 0 }, "slow");
            return false;
        });
        $(window).scroll(function() {
            if ($(this).scrollTop() > 200) {
                $(".btn-scroll-to-top").fadeIn();
            } else {
                $(".btn-scroll-to-top").fadeOut();
            }
        });
    });
    </script>
    ';
}
?>


Thanks, Rainer

Offline

#2 2018-09-12 20:44:16

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,938

Re: Phplugins

Hi Rainer, see if this works.  Note the addition of the class at the top and closing it at the bottom, the change of function name to just scripts, and the removal of the parameters passed to that function.

<?php

class PHPlugins extends APHPlugins
{
	function scripts()
	{
		echo '
		<a href="#top" class="btn-scroll-to-top" title="Top of page" ><i class="fa fa-arrow-up fa-lg"></i></a>
	<script>
		$(document).ready(function() {
			$(".btn-scroll-to-top").click(function() {
				$("html, body").animate({ scrollTop: 0 }, "slow");
				return false;
			});
			$(window).scroll(function() {
				if ($(this).scrollTop() > 200) {
					$(".btn-scroll-to-top").fadeIn();
				} else {
					$(".btn-scroll-to-top").fadeOut();
				}
			});
		});
		</script>
		';
	}

}
?>

Offline

#3 2018-09-12 20:48:33

Rainer Goergen
Member
From: Trier, Germany
Registered: 2016-05-01
Posts: 325
Website

Re: Phplugins

Thank you Ben, I am no programmer and I have no knowledge about phplugins.

Works !!!

Rainer

Offline

#4 2018-09-12 20:58:39

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,938

Re: Phplugins

I'm glad to hear that worked!

Offline

#5 2018-09-13 02:12:16

bdfisher
Member
Registered: 2012-09-25
Posts: 25

Re: Phplugins

Ben,

I join Rainer in thanking you. I followed the changes shown in your post and now my own phplugin file is now working.


Barry

Offline

#6 2018-09-13 07:32:56

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,938

Re: Phplugins

Thanks, Barry smile

Offline

#7 2018-12-29 09:11:56

Markus
Member
From: Witten - Germany
Registered: 2012-10-06
Posts: 177
Website

Re: Phplugins

Hi Ben,

I have now arrived at Backlight 2 and am trying to take over the already working settings from Pangolin (version 1.2.3).

Like Rainer, I also had the "Scroll-to-top-button" installed in the old version, which didn't work after the update.

With your code I get the arrow displayed, but unfortunately only at the bottom left when I have reached the end of the page.
On the Pangolin page the arrow already appeared when the upper edge disappeared. I also adjusted the arrow with my custom.css.

Unfortunately I can't get the change with my custom.css. Although I have already tested some things. With the Inspector I have to practise a bit first to find the right selector again, because it has obviously changed.

Will I be able to do the same as in Pangolin in Backlight 2? Here are my custom.css:

/* ----- Scroll to top button styling ----- */
/* ======================================== */
.btn-scroll-to-top {
    background-color: transparent;
    display: none;
    position: fixed;
    bottom: 7px;
    right: 15px;
    border: 1px solid;
    height: 32px;
    width: 32px;
    border-radius: 50%; 
    text-align: center;
    line-height: 29px;
    vertical-align: middle;
    text-decoration: none;
    color:#6f7c80;
	
}
.btn-scroll-to-top:hover {
    text-decoration: none;
    color:#ff0000;
		border-color: red;
}

a.btn-scroll-to-top {
	z-index: 3;
}

and the links to the Pangolin Page: https://backlight.der-canonier.de/ausruestung/
and Backlight 2 - page: https://pangolin.der-canonier.de/ausruestung/

I would be happy to receive tips.

Many greetings
Markus

Offline

#8 2018-12-29 09:37:49

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

Re: Phplugins

Hi Markus,

there appears to be an error in your custom css file.

Look at lines 57 to 62. There you have a portion of the code commented out. Line 57 starts with /* and line 62 ends with */. But in between there are other sections commented out (for example, /* IE6-9 */) and when that close comment after IE6-9 is encountered, it ends the commented section begun on line 57.

In the inspector, when I deleted lines 57 -62, the scroll-top button appeared where it should be.

So either remove lines 57 - 62 or, remove those internal comments or, instead of using the official comment syntax of /* .... */, you can use the line comment of // in front of what you want to comment out. At least that worked when I used it in the inspector.


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

Offline

#9 2018-12-30 03:42:46

Markus
Member
From: Witten - Germany
Registered: 2012-10-06
Posts: 177
Website

Re: Phplugins

Hello, Rod,
perfect - many thanks for finding the error. Now I like that again big_smile

On to the next point...

Best regards

Offline

#10 2019-01-13 23:43:36

Markus
Member
From: Witten - Germany
Registered: 2012-10-06
Posts: 177
Website

Re: Phplugins

Hi,

how can I make the "Scroll-to-top-button" appear on a large monitor in the .page__pallet__bottom or correspond with it?

So this is about the place.

Scroll-to-top

So the position should be fixed, but related to the .page__pallet__bottom - area.

If I change "right" in custom.css, the position moves logically when the monitor widths change.

Many greetings
Markus

Offline

#11 2019-01-13 23:55:18

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

Re: Phplugins

You don’t want it popping up as the user scrolls down the page, but only appear in the footer area?


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

Offline

Board footer

Powered by FluxBB