Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
Greetings.
Many of my thumbnail pages for Albums have over 150 thumbnails. Is there anyway to put a navigation line a the bottom of the thumbnails so that visitors can go back a page to either Gallery or Album Set instead of having to scroll back to the top? This would be in addition to the navigation line at the top of the thumbnails.
Thanks. I'm not good at coding, etc. Maybe there is a simple way to do this? Or, could you provide an example of the coding, etc?
jim
Last edited by coyotepixel (2017-01-21 02:09:44)
Offline
You'll need to use phplugins. The ttg_gallery_bottom hook would place content below the thumbnail grid.
http://backlight.theturninggate.net/doc … _phplugins
This should take the viewer back one level
<a href="../" class="button">BACK</a>
If you want it to be text rather than a button, remove class="button"
You can also change the link to direct it elsewhere, like directly to your Galleries page.
The whole function would be
function ttg_gallery_bottom( $style, $path ) {
echo '
<a href="../" class="button">BACK</a>
';
return false;
} // END
You may need/want to style it further with either inline or custom css
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Is there a way in phplugins to tell whether it's a gallery or a slideshow? I have a slideshow on my home page and don't want/need a back button there.
Thanks.
Charlie
www.stalkinglight.com
Offline
Thanks, Rod! I'll give it a try. It'll be my first phplugin effort.
jim
Offline
Is there a way in phplugins to tell whether it's a gallery or a slideshow? I have a slideshow on my home page and don't want/need a back button there.
Thanks.
I don't think so, but you could give the button or link a custom class and hide it with custom CSS.
Each page now has Template Type and Slug classes that can be used.
Or, even easier, us a different page template for the slide show pages, one that doesn't use phplugins.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
I use phplugins for my masthead, among other things. How do I access the template type in phplugins?
Charlie
www.stalkinglight.com
Offline
How do I access the template type in phplugins?
you don't, it's custom css.
But if you simply want the back button at the bottom of a thumbnail grid in an album, but you don't want it on a slide show, then create two identical page templates, one that used the phplugins file that inserts the link and the other that doesn't. Assign the page template that uses the phplugins file to your standard album template. Assign the other page template to the album template you're using for slide shows.
But if you want to go the custom css route:
If you give something a custom class, like a back button, then in the custom css you can use the body class given to the page in question. You'll need to look at the page's source code to see the classes given. You'll see one for template type, and one for slug.
Let's say you add a custom class to a that back link button that's placed below the gallery. I'll just call it "back-link":
<a href="../" class= "button back-link">Back</a>
In custom css, you'll add a rule that will hide that link on a certain page:
.type-album.slug-name-of-slug .back-link {
display: none;
}
Currently, the only page type classes are .type-album, .type-album-set, and .type-page. Using the slug class means you can target a specific page.
to see the classes, just look at the page source code for the body tag. It'll be near the top, around line 40 or so.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Thanks. Like I said, my masthead uses phplugins so I can't use a template without them. I'll take a look at the custom CSS route or just forget about the button altogether. ;-) I also have some videos where I don't want the button either so it might end up being more trouble than it's worth since I really don't want a back link just a link to go to the top of the page, which I did using . instead of ../.
Thanks again for the ideas.
Last edited by charlie.choc (2017-01-21 19:52:19)
Charlie
www.stalkinglight.com
Offline
But you can use templates that use different phplugins files.
Both files would include your masthead code, but only one (the one for regular albums) would include the code to place the link after the gallery.
Page template for regular albums uses one phplugins file.
Page template for slideshow or video albums uses the other phplugins file.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Gotcha. I'll have to think about what kind of maintenence issues that will cause me. Not a big deal since I do have time on my hands, but I'm a retired coder and it bothers me to have a number of similar files to keep track of.
Thanks yet again, plenty to think about.
Charlie
www.stalkinglight.com
Offline
Rod,
I'm gonna give a try to doing my first phplugin for my thumbnail pages. Let me know if this is right.
I've gone to backlight/custom/phplugins and found path.php. I downloaded a copy of it to my computer, deleted the contents through textedit and copied the function script that you gave me near the top of this post.
I then rename the phplugin to something other than path.php. I should upload this new script to backlight/custom/phplugins and then go through the Advanced Customization steps for phplugins for my thumbnail pages. This should give me a button below the thumbnails.
Does this sound right and will it work? Is there some name I should give to this script or does it matter?
Jim
Last edited by coyotepixel (2017-01-22 12:05:20)
Offline
That's completely wrong
I don't recall a path.php file for Backlight. But if there is, just leave it alone. (I'm not on my PC do I don't have access to the files)
Backlight comes with a couple sample phplugins files. Use one of them. But don't delete it all and then just add. There are pieces in there get are needed. Read the file, there is a user section for your code.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Glad I asked! I'll start over.
Offline
Ok.
My train of thought on this was:
I want a "back" navigation button at the bottom of my thumbnails. I know that I must create a .php script with that function and insert it into backlight/custom/phplugins folder as per the instructions on the "using_phplugins" page on Turninggate/Backlight:
Enabling PHPlugins
To use PHPlugins, create or edit an existing PHP file in /backlight/custom/phplugins.
In Backlight's Designer, edit the desired Page Template. Scroll down and set:
Advanced Customization ⇒ PHPlugins ⇒ Enabled : On
Advanced Customization ⇒ PHPlugins ⇒ Include File : file-name.php
Any page, album or album set utilizing that template will run functions from the specified script file.
I don't know how to create a new PHP script file, so I looked at the .php scripts already in backlight/custom/phplugins and found path.php.
I downloaded a copy and left the original path.php as it was in it's folder. I deleted the duplicates script and inserted yours and thought I should rename the new .php something like: back-button.php
I was going to insert the new back-button.php with your function for the 'back' button into backlight/custom/phplugins and assign that script through the Advanced Customization.
What you are suggesting is to go to the sample-phplugins.php and insert your function into the area designated for that, probably deleting the samples within. I've found that .php and see the area. You mention that there are other bits within that .php which are necessary.
If I do that, then I should assign that sample-phplugins.php to my Page where I want the back-button using the Advanced Customization?
Does that make the sample-phplugins.php unavailable for other uses? Should I rename it to something else?
I hope I got all the terms right in my effort to explain/understand/learn.
Thanks,
Jim
Last edited by coyotepixel (2017-01-23 03:11:00)
Offline
What you are suggesting is to go to the sample-phplugins.php and insert your function into the area designated for that, probably deleting the samples within. I've found that .php and see the area. You mention that there are other bits within that .php which are necessary.
If I do that, then I should assign that sample-phplugins.php to my Page where I want the back-button using the Advanced Customization?
Does that make the sample-phplugins.php unavailable for other uses? Should I rename it to something else?Thanks,
Jim
Yes, you can assign the sample-phplugins.php to the page template. And that file will be available to any page template.
Be street that you only change or add code in the designated user area.
Chances are that on your first attempt you'll break all pages using that file. That's ok, it's probably just a syntax error (been there, done that x 100). If it happens, disable phplugins for that page template and post the function you're using to the forum. Someone will spot the error.
Personally, I opened the sample file and immediately saved it as simply phplugins.php. I then deleted or commented out the sample functions and added my own.
I've also created files for specific use and named them accordingly and assigned those to specific page templates.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Many Thanks!
Will let you know what happens. Going for a hike in the Columbia River gorge in a few minutes
jim
Offline
Oooh. Is it still frozen there?
On phplugins, the CE4 docs will give you a better overview: http://ce4.theturninggate.net/docs/doku … bility_api
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Got it to work! Back button at the bottom of the page.
http://coyotepixel.net/galleries/favori … favorites/
I got a copy of the sample php from backlight/custom/phplugins, deleted everything inside of the box "set user functions below", inserted your function for back button, renamed it back-button.php, uploaded it into backlight/custom/phplugins, logged into my backlight settings, went to design template for my standard backlight page, Advanced Customization, Enabled phplugins, and included the back-button.php.
I may remove the blue button and just have the text. Easier to see. Thanks, Rod. My first attempt at php worked, thanks to your help.
PS, there was still 12 inches of snow last weekend in the Columbia River gorge.
Offline
You can change the button color in the typography section of your template.
Charlie
www.stalkinglight.com
Offline
you can also remove the button by removing the button class from the code.
Which trails did you hike? I'm heading there in late April, hopefully the flowers at the McCall Preserve will be blooming too.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Charlie,
I did change the color of the button to white. It made a big difference. Thanks.
jim
Offline
Pages: 1