TWEagle / galleriffic

Automatically exported from code.google.com/p/galleriffic
0 stars 0 forks source link

Image navigation and thumbnail links do link properly when base tag set #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Place base tag in head tag <base href="http://mydomain.com/" /><base>
2. Load gallery page
3. Click on navigation or thumbnails

What is the expected output? What do you see instead?
The url reverts back to base href instead of staying on the same page.

What version of the product are you using? On what operating system?
Galleriffic 2.0

Please provide any additional information below.

Hi,
When the base tag is present, I am taking to the home page instead of the
next set of images on the same page when I click the navigation "next"
above the images or a thumbnail.

For example,
Instead of this http://mydomain.com/gallerifficpage/#image,
I get http://mydomain.com/#image.

If I remove the base tag, all is well with the slideshow navigation, but I
want to use a base tag for my other links, etc.

Thanks for the great module,
Sam

Original issue reported on code.google.com by sampub%i...@gtempaccount.com on 20 Nov 2009 at 7:01

GoogleCodeExporter commented 9 years ago
My mistake, I added an extra <base> tag in the above message. 

Original comment by sampub%i...@gtempaccount.com on 20 Nov 2009 at 7:03

GoogleCodeExporter commented 9 years ago
Hi!

I wrapped jquery.galleriffic into an extension for TYPO3.
When configuring TYPO3 to produce nice URLs you have to use one of two 
extensions
(realURL or coolURI) which both need the <base> tag to be set.

So you can not have nice looking, SEO friendly URLs and a working galleriffic 
at one
time.

Possible solution:
galleriffics generated links should be made from the current location.href or
location.pathname plus the # anchor to the image.

@Trent:
With your knowledge of the code it should be a metter of minutes to fix this.
I will take a look at the code too.

Greetings

Jo

Original comment by johanne...@gmail.com on 18 Mar 2010 at 11:02

GoogleCodeExporter commented 9 years ago
Hey,

i have the same problem...

I added location.href.replace (/ # [0-9 ]*$/,'') to the code and now the links 
are
correct. but galleriffic doesn't update the displayed image now...

any solution?

greetings
chris

Original comment by c...@chsmedien.de on 24 Mar 2010 at 9:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I fixed this problem this way, written after $('#gallery').galleriffic...etc..:
$('#navigation ul.thumbs a').each( function() {
    var href = $(this).attr('href');
    var page_href = $(location).attr('href')+'#'; // add # to have at least one hash for the next line
    page_href = page_href.substr(0, page_href.indexOf('#')); // strip from # to the right
    $(this).attr('href', href.replace(/^(#[0-9])$/, page_href + "$1")); // replaces only if not replaced before, so it is runagainproof
});
Well, you have to change the "#navigation ul.thumbs a" part.
Hope it helps.
Max.

Original comment by maxori...@gmail.com on 17 Nov 2011 at 2:22