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.
Other than hiding it with CSS, can it be removed entirely (with PHPPlugins)?
I'm wondering, what is the permalink button even for?
It's being picked up by search engines, and I'd rather just remove it (instead of hiding it).
What's generating it, and is there a way to control this?
I'll spare you the long story about the head scratching and head banging on how I found this. Here's the bug.
Go to the file /backlight/modules/pangolin-album-set/dynamic/css/iconic.php
Look at the following section of the code, and see if you spot it.
/**
* @ screen breakpoints
*************************/
.albums {
max-width: <?php echo $model->value('gallery.max_width') . 'px' ?>;
}
.albums figure {
width: calc( <?php echo abs( 100 / $model->value('classic.at.1920') ) . '%' ?> - <?php echo $model->value('cell.margins') * 2 . 'px' ?> );
}
@media only screen and (max-width: 1680px) {
.albums figure {
width: calc( <?php echo abs( 100 / $model->value('iconic.at.1680') ) . '%' ?> - <?php echo $model->value('cell.margins') * 2 . 'px' ?> );
}
}
@media only screen and (max-width: 1440px) {
.albums figure {
width: calc( <?php echo abs( 100 / $model->value('iconic.at.1440') ) . '%' ?> - <?php echo $model->value('cell.margins') * 2 . 'px' ?> );
}
}Hint (if you still need it but not to entirely spoil the fun): It's a copy/paste bug. This is the iconic.php file, but contains a variable from the classic file.
Workaround: I corrected the variable in my copy of iconic.php file, and then cleared the template cache. Now I'm getting the correct behavior. My fix is safe until the update. Your welcome ![]()
PS: while you're in the iconic.php file, don't forget to add the following fix I found previously:
.albums figure {
vertical-align: top;
}
All the recommendations I've read are to not split up your photos into multiple catalogs. Best to keep Lightroom in a single catalog. There once was a limitation in the size of a catalog, but that hasn't been true for at least five years.
About the only time a single catalog has a downside is if you've got about a million photos and process hundreds of images a day. Otherwise, life is good with just a single catalog for everything. There are many downsides to having all your images across multiple catalogs.
https://helpx.adobe.com/lightroom/help/ … asics.html
Can Analytics help us improve our SEO?
I don't think you understand Google Analytics. It's not about SEO. It's for tracking user behavior and statistics about your site.
Everything you outlined above in Reason 1 and Reason 2 can be done in Google Analytics. In fact, that's what GA was designed to do.
It's also free, less complicated, will not slow your site, less maintenance, custom reports, and so on. I can't think of one negative for using GA, but I could list a few for trying to do this without it.
If it ain't broke...
That's exactly why I'm recommending you stick with GA, and not go down this rabbithole that turns into a tar-baby.
I'll give up trying to convince you, but after some time I'm certain you'll find this statscounter wasn't worth the effort. It's making a simple problem more complicated. In the end, you'll spend more time going down this path and not get any more for the effort than if you used Google Analytics with the User ID as I've recommended.
Google analytics doesn't show IP's for privacy reasons
Yes, it is a privacy matter and that's important. And it's also illegal in some countries.
You really don't need the IP.
Step back from the problem for a moment. You're not trying to track IP addresses. You're trying to track individual user behavior. This can be done in a way that protects privacy.
Tracking an IP address will fail to capture what you're assuming it will do. Every device used by a person will have a different IP, and that same device will get a different IP at a different location. Imagine this...
Mary Jane is sitting at her home, then visits your site on hre mobile phone - that's one IP.
Then she picks up her laptop because it has a bigger screen, then that's a second IP.
Mary then goes to work with her laptop, that's a third IP.
Mary is sitting at Starbucks and shows her friends some of the photos on her phone, that's a fourth IP.
Mary goes home and uses her laptop again. This time it reconnects to her home router and due to DHCP it gets a different IP than it had the day before. That's a fifth IP.
Next, you're doing wedding photography so the scenario above doubles when Mary's new husband does the same. In this simple example, there will be up to TEN DIFFERENT IPs.
Wait, it gets worse. Mary also gave her log-in info to her mother and a few friends asking them to help her pick. Now you've got well over a dozen IPs to track down.
So you see, tracking the IP doesn't actually solve the problem. You're trying to track a user's behavior, not their IP. You're also making the actual problem more complicated. For example, which of the dozen or more IPs in the scenario I've just outlined are the individuals you are actually trying to track? That's going to take a lot of detective work, and to what end?
I'm certain you'll find that even after you get that code working, it doesn't work as well as you're expecting. For this you will just have to trust someone with experience that's been coding web sites.
Back to my recommendation to use Google Analytics. Note that Matt has already provided the Google Analytics code sample. You could have had that code up and running in less than and effort than this rabbit hole has taken.
It's good advice to take the short path to get something working, than to plow deep into unknown territories. Coding is a story of Br'er Rabbit and the tar-baby. Once you touch it, you'll get more and more stuck with it. Experienced coders have learned this lesson all too well.
My advice again, step back from the problem. The solution isn't StatsCounter because tracking IPs isn't giving you the result you're looking for. You may not be able to get exactly what you want without making your site very complex and difficult for your visitors (e.g. requiring them to always log into your site).
Google Analytics will get you close with much less effort. And you'll already have GA installed so the slight change avoids another tar-baby.
https://conversionxl.com/blog/universal … s-user-id/
https://developers.google.com/analytics … es-user-id
https://davidsimpson.me/2014/04/20/tuto … analytics/
https://www.lovesdata.com/blog/google-analytics-user-id
Google analytics can give you all sorts of data
And the new Data Studio lets you create some nice dashboards. I've created some interesting things using simply standard Google Analytics.
I was under the impression that this is how a java script was added.
Can you show us the original code you were provided. Then we can show you how to add it to PHPPlugins.
It's also important to know where the code should be added. In the wrong place it can slow your web site.
And this only gets you the statcounter on your Backlight photo pages. You'll need another method to get this on your WordPress pages, assuming you want to track those as well.
<?php
function ttg_scripts( $style, $path ) {
<script type="text/javascript">
document.write('<div align="center">');
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>} //END
?>
It's just as the error states. This code is not valid PHP and is generating a "syntax error."
The file to be used with PHPPlugins is a .php file, and as such should have <?php at the top and then end with ?>. The functions that appear within the php file should not repeat this.
The other error is the <script> and </script> tags.
There's another problem with this code, such as where are you expecting the output on the web page?
I can guess that you're trying to include http://statcounter.com/ but for what purpose?
If you simply want to know how many visitors, you could probably just get all this done with Google Analytics. Maybe there's something else you're looking for.
I found there's a simple way to install that code, as documented here: http://statcounter.com/support/knowledge-base/14/
Also note that if you install the code into Backlight's PHPPlugin, then you won't have it in your WordPress pages. If I recall you are also using WordPress, so if you want to track WP pages then you'll need to add the code there too.
Is LR making me crazy? Or has this happened to anyone else?
First questions, most likely yes, but it's not just Lightroom but a number of other computer-geeky things. Second question, most likely no if they understand computer-geeky things and have enough experience publishing from Lightroom.
Most importantly, to help save your sanity, it's not random. It's doing exactly the same thing it's always done for everyone, in a very predictable way. I outlined how sorting actually works.
The part that's driving you crazy is when you SEE it working (when it's just luck but you think it was working) and SEE it wrong, when it's not (and think something is wrong).
To make this predictable for you, and to stop driving you crazy, you need to change your file naming convention.
You MUST use a consistent number of digits and pattern(s) in ALL the files for any given collection.
Read that last line again and again until you understand that entirely. If you start getting crazy about sort order, repeat that rule to yourself and look for how you violated the rule.
Here's the workflow I'm recommending to save your sanity and save you hours of needlessly wasted time.
All files as they are being imported, especially from multiple cameras or multiple sources, need to have the same file naming convention.
For example, if you use a prefix such as the name of the shoot or initials or whatever, then all the photos should have that exact same prefix.
Even MORE IMPORTANT, all the files need to use the same number of digits if you expect sorting by file name to ever work. For example, if you will have less than 1,000 photos in a collection then use three digits (e.g. 001, 002, 003...999). If you ever have less than 10,000 then you need to use four digits.
All files as they are being imported, especially from multiple cameras or multiple sources, must never have the same file name. When LR finds a duplicate name in the same collection, it must change the file name and does so by adding a suffix (e.g. "xxx-11" because it found ten other previous duplicate names). This additional numbering pattern being added to your file name will make you crazy. It will also interfere with later renaming files. (read that last sentence again and again, this will bite you as you try renaming them if you have such a problem).
To prevent the duplicate name problem from multiple sources, use a unique identifier for each source. For example, for two photographers named Joe and Bob, have them submit their files as "joe-event-001" and "bob-event-001". Just realize that the name of the files during import is to avoid duplicate names. You are going to RENAME all files AFTER you have them in a single collection within Lightroom.
Once you have ALL FILES in the collection imported, you can re-sort them however you wish (file name, capture time, etc). If you want a custom order, then drag them while in the Library into the order you want. AFTER getting them all in the order you want, THEN AND ONLY THEN rename all the files using the LR Rename option. Create a name template for this, such as "custom text"-{xxx} where the last three digits are a sequence. Note, you are setting the order and renaming all files while in the Lightroom Library (not within the Publisher).
After renaming your files to have a consistent naming convention, and all have the same number of digits, then and only then do you move on to adding them to Lightroom's Publisher.
Once the photos are in the TTG Publisher, avoid the "managed by Lightroom" option, the part that is driving you crazy.
Once you have all the files in a TTG Publisher album, select "sort by file name" within the TTG Publisher dialog. Note I'm suggesting you ignore the Lightroom sorting options. You're going to set the sort preference using TTG Publisher.
Click Publish and you will find the files on your web site in the same order you choose while in the Lightroom Library, which is going to be the same as you see them in the Publisher.
TTG's file ordering will re-arrange them if the numbers are, -1, -2, -3 etc.
They have to be -001, -002, -003, otherwise you get something like this:-1, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -2, -20
The ordering you're objecting to is the actual sort order for such file names. The order you find on your web site is the proper order according to the file names you're showing.
That's why I said "IF you have all the file names in the CORRECT order" - it will work.
But file names like "MJ-1-11" an "MJ-10-11" will not sort as you are expecting them to.
In the two examples above, the fifth character is "-" in the first one, and "0" in the second. 0 comes before - in sort order.
I would expect if you viewed your list of files in your computer's desktop, you'd find they sort in the same way as you find them on the web server.
What you want to do, going back to my previous recommendation, is to create good file names that sort properly. You can rename files using many patterns, such as a prefix (e.g. "MJ") and a sequence number (e.g. "-001").
You need to get rid of that problematic pattern of that number sequence in the middle. The problem with it is that it's an inconsistent number of digits.
You can't expect a proper sort to be based on numbers like: 1, 10, 100, 11, 110, 111.
The "problem" you're seeing in Lightroom Publisher is that LR is NOT showing the "correct" order. Apparently it's ASSUMING the middle sequence is a number, and NOT characters. THis is a BAD assumption. It's a BUG in LR.
You can try viewing your list of files in their actual order by looking at your directory of those images in your desktop. Click on one of the images in LR and choose "show in desktop" or what ever it's called on your Windows system (I'm a Mac user).
View that window on your Windows desktop, using a list view, and sort by file name. You should find the order there matches what you find on your web site.
If you are going to use numbers to sort your file names, then they ALL MUST HAVE THE SAME NUMBER OF DIGITS.
You can do this, as I was suggesting, using Lightroom's Library to rename your files.
Let me give you an example. Here's a simple list using just one pattern of digits. I dropped your "-11" suffix to make it more clear. Look at how these names actually sort.
MJ-001
MJ-01
MJ-010
MJ-1
MJ-10
MJ-100
MJ-11
MJ-2
MJ-20
MJ-200
MJ-22
MJ-3
As you can see, you cannot use a mixed number of digits in the file name and expect them to sort "correctly." You need to have all files with the SAME NUMBER of digits. Here's a similar list, using three digits, and how it would sort.
MJ-001
MJ-002
MJ-003
MJ-010
MJ-011
MJ-020
MJ-022
MJ-100
MJ-200
To sum up.
You're looking at a flawed sorting in Lightroom's Publisher.
Sorting by file names that use numeric sequences require you use a consistent number of digits and patten in all file names.
From there they appear in perfect order, when I select 'sort on filename'.
Since they are showing up there how I want them, choosing the 'Managed by LR' from the Photo Order option in Edit Album, seems the logical choice. That's when it all goes 'Peter Tong'.So I don't need to change the order manually in the Publisher view, because they are all in perfect order. It's the actual publishing that messes it all up.
IF you have all the file names in the CORRECT order, then you simply want to set TTG Publisher's "Photo Order" to Order by File Name.
That might be a pretty good idea.
Create a new album set in Lightroom Publisher.
Move the albums into it.
Delete the old album set
Rename the new one
I had some odd problems about Lightroom not sync'ing to the correct location on the web site. When it was really strange, I did the above steps. I have dozens of albums, and after migrating from CE4 there were a couple that just wouldn't sync correctly.
I found the above was the quickest way to fix the problem.
I would select all the photos in the old album. Then create a new album with the selected photos. I found this even keeps my custom sort order.
I would set the new album to be hidden. Set everything in the new album to be the correct info (name, description, etc). Just change the slug to "NEW" or something just so it's different than the correct/old slug.
Publish the new album. Confirm the new album is correct on the site.
Delete the old album. Then rename the new slug and change it so that it's no longer hidden.
For manual ordering, make sure that Photo Order is set to Managed by Lightroom.
Order the images as needed in Lightroom
Right click on one of the images you moved and select Mark to Republish
Publish
This has always worked for me.
Also, make sure that at the bottom of the TTG Publisher panel, you have Lightroom set to Custom Order.
I also use Custom Order and have Backlight set to Managed by Lightroom. I drag my photos into the order I want. This has always worked, and I've done it this way for many years with TTG. I have hundreds of albums published this way.
The only time Custom Order doesn't work is when Lightroom doesn't trigger updates to Backlight. At times I can re-arrange one image but it doesn't get updated on the web site. If I mark that image to be republished, then it writes out the file in the correct order. You can probably do this with just having the metadata being updated to save a lot of time.
Another frustration with Custom Order in Lightroom is that when you first add your images into the publisher album, they are all set to "new photos to publish." At that moment you cannot set the customer order you're trying to get. You have to publish (upload all the images to your seb site) and then re-arrange them into the custom order. This can be slow and awkward. Plus, I've also ran into several bugs in Lightroom while doing this.
Peter,
My suggestion is to change your workflow. Get the files renamed in Lightroom before moving them into TTG Publisher.
After importing your images into Lightroom, reorder them as you want while they are in the Library. Then rename all the photos with a good name and sequence number. For example, "MJ-001" or something. After doing this your custom ordering will be the same as "sort by file name".
Then when you add the photos into TTG Publisher, you can simply trust Backlight to sort by file name. This way you avoid the bugs in Lightroom Publisher. You will be able to quickly create a new TTG Publisher album, and in one-click have them published to your site in the right order. It's a lot less frustration, and you don't have to worry about getting the order correct on the site and messing around in Publisher.
When images are imported into LR, the file name (well, 'tag'?) is changed.
For eg. the real file name is MJ-1.jpg and after import, it becomes MJ-1-11.jpg
This is a question about how Lightroom imports files?
Can you explain your workflow. How do you import files? What are your LR settings? Has this always been true, or is this something new? What LR settings have you changed recently. Have you changed your workflow recently?
In Publisher, there is an option to let Lightroom manage the Photo Order. What does it do?
While viewing your photos within LR, you can set their order in the toolbar below your images. You'll find Capture Time, Added Order, File Name, etc. You can also drag images to change the "custom order." If you want this order to be the order they appear on the web site, then select "Managed by Lightroom" in the TTG publisher dialog.
I can't guess what's happening with Q1 and Q3 without knowing your Lightroom workflow for importing images. When I import, LR doesn't change the name. I suspect you're getting name collisions, and LR is forced to rename them. This could happen if you actuall to have more than one file with the same name. But it can also happen based on your import settings.
peter, I looked at your site with my browser inspector. I'm seeing that each of your pages (each one in the top navigation menu) is using a different page template. Yikes!
Here's my advice (2 cents worth).
Stick with just one page template for all of your web pages (home, about, contact, pricing, blog, etc). Those pages are basically just text with an occasional image. Let's call those "normal" web pages.
Using just one page template for "normal" pages will keep the entire site consistent, and save you a lot of work trying to keep the site consistent.
For your galleries of photo albums and albums sets, you might want a different page template. This depends on if you can design a "normal" web page template that also works for your photo albums.
My site has more pages than yours, but I only have two page templates. One for "normal" text-based pages such as home, about, and contact. I have only one other page template for photos.
Reducing the number of page templates will greatly reduce your frustration and effort to keep each page consistent. I can't really even think of a good reason to have more than one page template for "normal" text based pages. Trying to make each page look different isn't a good design.
Focus on the content first. Get all the basic stuff in place so you can get the content up. The content will help shape your design.
After you get the entire site nearly complete, if you find that you still want to change the design of one page, then and only then consider another page template. You can select the one page template and duplicate it. Make the slight change to that one template and assign it to that one page. This will save you a lot of frustration and time.
Not something I want to handle in templates. So it would have to be an option in Settings, which usually requires updating the database, and jumping through other hoops. Not really worth it just for this. The next time Ben is prepping a big update, maybe. I think for now, though, I am going to go ahead with my previous proposal, just making it a part of the basic snippet.
Analytics tracking code can be complex. I track events, such as clicking buttons that download. It's such a custom operation with different needs when you go beyond the very basic (as provided by Backlight).
I'd rather see the PHPlugins sample code updated to include an example of how to add analytics tracking code. That would be enough to quickly get people like me started. I already have PHPlugins running now. Adding my own tracking code is on my do to list. I just didn't realize I could remove the Backlight code by simply removing the tracking ID.
disable Google Analytics in Backlight's settings
I had looked for how to do this, but didn't see it. I know how to disable it in the Wordpress theme, but not in Backlight.
Do you simply leave Google Analytics Web Property ID blank?
Rod, I think he's asking how to add the following line to the Backlight Google analytics tracking code. It's missing in the Backlight code generated for tracking.
ga('set', 'anonymizeIp', true);This is an option that Google prefers to be used in their tracking code. It's also a legal requirement for some parts of the world (e.g. Europe)
peter, I think if you lower the number of columns you'll get what you're asking for.
Look in the Columns at Screen Breakpoints of your template. That controls how many columns there will be for the width of the page. Fewer columns means larger thumbnails.
Set the entire range across all breakpoints. On the small screen of a phone in portrait mode just 1 or 2 is all that fits. You can test this by making your web page narrow and wide on your large computer screen. You can even resize the screen and watch how the thumbnail will dynamically resize, according to the number of columns you've set.
This gets complicated due to the nature of a responsive page layout. Check what happens we you go narrow and then wide with the page. You'll see how the thumbnails will grow until the next column breakpoint.
You can set the number of column for the different page widths in your template under: Columns at Screen Breakpoints
You wont' see much of any difference until and unless you have a few column of thumbnails visible.
The size of the thumbnail is the size of the image that's created. The size of the "figure" you see on the page is based on the number of columns on the page.
I'm so baffled by the Backlight htaccess rules. It's just total voodoo to me right now. When I find strange things happening on my site, it gets down to Backlight's htaccess. I've been deleting them all my "problem" directories. When they're gone, everything seems to work just fine. When they're there, I eventually find them to be the source of mysterious problems.
The latest issue is that I renamed several old directories in the new site. To create the redirects, I first tried using the cpanel for my site. But that wasn't working (probably due to Backlight's htaccess). Then I found that it's easier to do this within the WordPress plugin Redirection.
All of my portfolio is within the main directory /photos/ (typically named /galleries/ but I've set all of TTG and Backlight to be based on /photos/). Here's how my site is structured, from the root directory.
/backlight/
/photos/
/photos/gallery-1/
/photos/gallery-2/
/photos/gallery-n/
/photos/99-models/gallery-1/
/photos/99-models/gallery-2/
/photos/99-models/gallery-n/
I created all the rules in Redirection for all the renamed galleries, and they work, so long as I don't have the Backlight /photos/.htaccess file.
Here's an example of what I've got. The old directory was /photos/99models/ and is now /photos/99-models/. Within /photos/99-models/ there are dozens of more directories. The regex rule for this is:
Source: /photos/99models(.+)
Destination: /photos/99-models$1
That works great in the WordPress plugin Redirection, when there is no Backlight /photos/.htaccess file.
I tried writing the same rule above within Backlight /photos/.htaccess but I couldn't get that to work. So I'm always coming back to, Backlight's htaccess file always causes problems for me yet if I remove it nothing "bad" seems to happen.
Backlight adds a htaccess file into every one of its pages and albums. But I found those don't seem to cause a problem. It's only the one in the main directory /photos/.htaccess.
Can someone explain what are the rules in Backlight's htaccess file?
Will anything "bad" happen if I simply remove all of them?
Do I really need the Backlight htaccess files?
If I should keep it, then how do I redirect the dozens of directories that I renamed?
I'm struggling to understand your terminology. The collection of photos created in Lightroom is your album. In this case, it's "brandon & julie".
In Backlight you create templates. Some are for pages, others are for albums (collect of photos), and there are album sets (a collection of albums).
The missing item is a "page template" but I don't know if that's the same one as the others. If so, then all you have to do is assign that (client select) "page template" to that (brandon & julie) "album"
When you say Backlight "can't find that landing page" I think you're saying the (brandon & julie) "album" is no longer associated with your client select "album template"
You can assign the album you created in Lightroom to any of your album templates. While in Lightroom, edit the album and you can select one of your templates.
You can also assign your album templates within Backlight at the Publisher page for top-level galleries. Start with the top, where you're albums can be found, and find the album in question (brandon & julie). When you find it, you can assign the album template you created (which is the same one as all the others, if I understand you correctly).
If you go to the Backlight web page, choose Publisher > Top-level Galleries
From there you should be able to assign the top-level galleries by clicking EDIT
You can also drill down and view all albums within that gallery, and assign their templates as well
You can also click on VIEW to go to those pages and albums. Do that and note the URL. Make sure that's the same URL you thought it was.
I had just found another couple threads mentioning the problem with using a sequence. I understand how/why it's a problem.
I came up with a work around to get the result I'm looking for. This even works better because I can start with the file name on the web site and find the original in Lightroom quickly.
I can use <folder>-<original number suffix>.
This gives me files names like "Jane-Doe-0274" and "Betty-Sue-5381"
This will avoid the name collision that happens with sequence or image numbers. Besides, I really didn't care what the number was!
Still, it sure would be nice to have sequence or index available during publishing.
BTW
I use <folder> because I put all my image sets into a good folder name (like the name of the model or location of a landscape).
I hadn't thought of it before. Using the LR folder name is a much better workflow for me. 95% of the folder names I was using were good names in general. When I realized I could use the LF folder name during publishing, I only had to modify a few. Then republish all albums. That gave me good file names (which can help SEO).
Then I realized the folder name could also be a good default caption name! So I update my LUA code in my Backlight template that writes out the caption to this:
{LUA= if Caption ~= "" then return sprintf('"%s" %s %s', Caption, Month, YYYY) else return sprintf('"%s" %s %s', Folder, Month, YYYY) end}Now the caption that appears in the web site is the LR folder name, which is good for most cases. For images that I wish to create a better caption, I add it to the LR metadata. Doing things this way is an easy workflow to my entire process of moving images from the camera to the web.