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.
Hi,
Is it possible to not show the file names when going over an image with your mouse?
When I go over an image in my gallery I see files names appear.
Also when right clicking on an image the option to save an image is possible. Any ways of getting rit if this?
Regards,
Cris
Offline
Is it possible to not show the file names when going over an image with your mouse?
This is a function of the browser. You can Google around and find some script that might do what you want. Then use phplugins and insert the script using the scripts() function.
Same with the right-click save issue.
Changing browser function isn't supported by TTG (I feel safe in saying that since Matt has been pretty vocal about it).
That being said, if you want to do this on your own, it's up to you. Here's something from the CE4 documents about it: http://ce4.theturninggate.net/docs/doku … ntext_menu
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 also thought about that, but anybody can still make a screenshot to save the image;-)
Offline
It's the risk we run. I choose to watermark images and not worry too much about it.
But I imagine your images have much more commercial value. They are pretty awesome
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 found the following script:
function add_custom_tooltip(){
?>
<script>
jQuery(window).load(function(){
jQuery('a').removeAttr('title');
jQuery('img').removeAttr('title');
});
</script>
<?php
}
add_action('wp_footer', 'add_custom_tooltip');
When I add the code, the filenames do still appear when holding the mouse over an image after 2 seconds.
Offline
That's a script meant to work in WordPress.
It first creates a function, and then calls that function in the WordPress Footer via the WordPress add_action function.
What it does is remove the title attribute from images and links, which keeps the tooltip (the little box that would appear next to the mouse pointer) from appearing. But it does nothing to disable the url showing at the bottom of the browser.
If you want to remove the title attributes, this is what it should look like in phplugins.
function scripts () {
echo'
<script>
jQuery("a").removeAttr("title");
jQuery("img").removeAttr("title");
</script>
';
}
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Oh.. I am such a noob at this.. I do try to understand it. So, it does not disable the filename of the image?
When I hover with my mouse over an image in my showcase, I see the file name appear, like in the image below.
I am looking for a script or something that does not allow the files names to appear.
Offline
If there's a file name in the image's title attribute, then you'll see the file name
The script disables the title attribute of the image or link.
What is that a screen shot of? An album thumbnail grid? If so, that script should remove the title attribute and therefore the filename that's in that attribute.
in that script above, if you only want to remove the title attribute from the images and not links, then just remove the part concerning links:
jQuery("a").removeAttr("title");
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
If you assign a title to the image, then the title will show instead of the filename.
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
It’s working for me.
Can you post a link?
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
http://www.aimhigh.aero/galleries/showcase/
If you assign a title to the image, then the title will show instead of the filename.
In Lightroom or the publisher module?
Last edited by Crizz (2019-02-21 03:18:58)
Offline
Still showing, cleared cage etc. script is not removing the image filename.
the script isn't being loaded on the page.
Have you added it to your phplugins file? Is your page template using that phplugins file?
If the answer to both is yes, then there's likely a problem with your phplugins file. You can post the contents of the file here, or feel free to email it to me and I'll take a look.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
http://www.aimhigh.aero/galleries/showcase/
If you assign a title to the image, then the title will show instead of the filename.
In Lightroom or the publisher module?
In Lightroom. Populate the Title metadata field in the Library Module. Then republish the images.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Wait a minute...
Have you added it to your phplugins file? Is your page template using that phplugins file?
I do not have a page template for the page... it is an album directly placed under the menu button showcase..
That is why it will not work...I guess..
Offline
The album template uses a page template. That page template needs to be the one using the 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
I am trying so hard to understand.. it making me nuts. I really really appreciate your efforts in making me trying to understand it.
Now.. I managed to find the page template that was used by the album, I activated .phpplugins on that page template.
I have also added a title to the first image..
Title works.. that is awesome! It shows a title instead of the filename.
Script does not work, other images still show filename.
Here is how my phplugins look:
<?php
/*
* TTG Core Elements "PHPlugins" User Hooks v1.2 - initialization mainline
*
* developed by john bishop images (http://johnbishopimages.com)
* for Matthew Campagna of The Turning Gate (http://theturninggate.net)
*
*/
function user_load($style, $path) {
$g_tsvrl = explode(' ', $style); // Extract gallery type
define ('G_STYLE', strtoupper($g_tsvrl[1])); // and set global for later
$g_path = str_ireplace('\\','/',$path); // change \ to /
$chunks = explode('/',$g_path); // and put into array
define ('G_PATH', strtoupper($chunks[count($chunks)-2])); // gallery folder name is second to last
//define ( 'TTG_SITE', ''); // set new site root for navigation, resources, etc.
}
if (defined('BACKLIGHT_HOOK')) {
require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
}
class PHPlugins extends APHPlugins
{
function head() {
echo '<link rel="stylesheet" type="text/css" media="all" href="/backlight/custom/vanilla-form/css/vanilla-form.min.css">';
echo '<script src="/backlight/custom/vanilla-form/js/vanilla-form.min.js"></script>';
}
function scripts() {
echo'
<script>$(document).ready(function() {
var myForm;
myForm = new VanillaForm($("form.vanilla-form"));
});</script>
';
function scripts () {
echo'
<script>
jQuery("img").removeAttr("title");
</script>
';
}
}// END /**/
Offline
you're calling the scripts () function twice. It can only be called once. Put the script that disables the title attribute directly after the first script you're using. It should end up like this:
function scripts() {
echo'
<script>$(document).ready(function() {
var myForm;
myForm = new VanillaForm($("form.vanilla-form"));
});</script>
<script>
jQuery("img").removeAttr("title");
</script>
';
}
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline