This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 10 - Pages: 1 - Last Post: 28 Aug 26, 18:18 Last Post By: nigel-aves Threads: [ Previous | Next ]
nigel-aves

Posts: 99
Registered: 23-May-2023
Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 24 Aug 26, 15:56
 
  Click to reply to this thread Reply
I was getting many errors on Google Webmaster about duplicate pages, etc. I did some investigation and discovered that with jAlbum/Skins the following should work in the Header section.

<link rel="canonical" href="${albumUrl}${pageUrl}">

This is produced in the header section:

<link rel="canonical" href="https://gallery.soft-focus-imagining.com/index.html">

This sort of worked OK but I was still getting errors in Google. On investigation, because Tiger skins use Lightbox, and the way that Lightbox works, I had to drop the "index.html", so I checked and set the following:

<link rel="canonical" href="${albumUrl}}">

Unfortunately, that didn't work, and I had this in the header section :

<link rel="canonical" href="}">

Is there any chance of getting this fixed, and/or maybe you might also consider putting this officially in the skins.

Many Thanks - Nigel.
JeffTucker

Posts: 8,656
Registered: 31-Jan-2006
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 24 Aug 26, 16:00   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
nigel-aves wrote:
...I checked and set the following:

<link rel="canonical" href="${albumUrl}}">

Unfortunately, that didn't work...


No surprise, there. Syntax error. Look at those curly braces. ;)
nigel-aves

Posts: 99
Registered: 23-May-2023
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 24 Aug 26, 16:18   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Very good catch.

Unfortunately, it still didn't work. You now get:

<link rel="canonical" href="">
JeffTucker

Posts: 8,656
Registered: 31-Jan-2006
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 24 Aug 26, 16:24   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
It works when I do it, but picking up the album URL is a little finicky, for some reason. Save the project, close the app, relaunch, reopen, and make sure you're seeing the correct address under Settings > General > Address. Then try making the album again.

And remember that the album URL is unknown until after the first upload.
nigel-aves

Posts: 99
Registered: 23-May-2023
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 24 Aug 26, 16:47   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Tried your suggestion, but no matter which site I test this on I always get the same result.

<link rel="canonical" href="">
JeffTucker

Posts: 8,656
Registered: 31-Jan-2006
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 24 Aug 26, 17:00   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
Ah! The variable is case-sensitive. Try ${albumURL}

ETA: Or failing that, just hard-code the sucker:
<link rel="canonical" href="https://example.com">
nigel-aves

Posts: 99
Registered: 23-May-2023
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 25 Aug 26, 00:11   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Because the Tiger series (and others) use the Lightbox method for photo display that "simple" fix doesn't work. It took me some time to actually get this working correctly.

I'm going to test my "fix" some more and when I believe it's good I'll post in the Forum what I did in case someone else needs it.
JeffTucker

Posts: 8,656
Registered: 31-Jan-2006
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 25 Aug 26, 00:14   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
I would suggest, instead, that you stop "coding for Google." It's usually a fruitless exercise. Create the best content you can, and let people know how to get to it.
nigel-aves

Posts: 99
Registered: 23-May-2023
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 25 Aug 26, 00:51   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I know this is where we disagree, but sadly Google is the big dog of web searches. Friends etc I can notify, it's the rest of the world I'm trying to get too!

It all seems to be working correctly
Laza

Posts: 1,588
Registered: 6-Sep-2005
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 28 Aug 26, 12:22   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
I can't see why Jeff's solution won't work. Add this to the Settings / Tiger / Advanced / Custom code / <HEAD> box:
<link rel="canonical" href="https://example.com">
nigel-aves

Posts: 99
Registered: 23-May-2023
Re: Enhancement Request, might be a bug :) Marking pages as "canonical"
Posted: 28 Aug 26, 17:54   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza,

I did try that in the past and I had the same issues reported by Google. According to resources on-line the line has to look like this:
 <link rel="canonical" href="https://yoursite.com/your-page-url"


I did try
<link rel="canonical" href="${albumURL}/${pageUrl}">
BUT the albumURL only worked for level 0, level 1 down it was missing in action!

This is probably more complex than needed but I'm not a programmer but I do understand programming principles. Also, according to the on-line help using Lightbox was an issue because it flattened to a single level all the graphics files. So with on-line AI help I came up with this to resolve both issues. (Don't laugh at me to hard, please!!)

<link rel="canonical" href="https://Your.Website-URL.com/${currentFolder.pathFromRoot}<ja:if test="${currentFolder.pathFromRoot}" value=""></ja:if><ja:else>/</ja:else>">
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "ImageGallery",
  "name": "${albumTitle}",
  "description": "${albumDescription}",
  "url": "https://Your.Website-URL.com/${currentFolder.pathFromRoot}<ja:if test="${currentFolder.pathFromRoot}" value=""></ja:if><ja:else>/</ja:else>",
  "hasPart": [
    <ja:fileiterator>
    {
      "@type": "ImageObject",
      "name": "${title}",
      "description": "${comment}",
      "contentUrl": "https://Your.Website-URL.com/${currentFolder.pathFromRoot}<ja:if test="${currentFolder.pathFromRoot}" value=""></ja:if><ja:else>/</ja:else>${fileName}",
      "thumbnail": {
        "@type": "ImageObject",
        "contentUrl": "https://Your.Website-URL.com/${currentFolder.pathFromRoot}<ja:if test="${currentFolder.pathFromRoot}" value=""></ja:if><ja:else>/</ja:else>thumbs/${fileName}"
      }
    }${ja:iflast}${else},${ja:endif}
    </ja:fileiterator>
  ]
}
</script>


And this created the correct href= for every page and all are unique to that page.

Edited by: nigel-aves on 28 Aug 2026, 09:55

Edited by: nigel-aves on 28 Aug 2026, 10:17
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums