[FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

danimal
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Mon Apr 03, 2006 12:52 am

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by danimal » Sun Jun 18, 2006 6:37 pm

The anchor is not within content, it's in my template, in the footer.

havshoei
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Thu Dec 29, 2005 2:01 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by havshoei » Mon Jun 19, 2006 5:17 am

danimal wrote: I installed the fix and it still doesn't work. with core joomla sef or open sef.
i believe this had to do with anchors within content items. my problem is all my anchors redirect me to the home page. they will work on the home page though.
Please note that core SEF only handels anchors that comply with HTML 4, that means only strings matching the pattern "[A-Za-z][A-Za-z0-9:_.-]*"

A link as [href="#5"]  pointing to an anchor [] do not match this pattern as it do not start with a letter "A-Za-z" (upper- or lower case letter in the range A to Z), it starts with a digit.

Change your anchors to comply with the above (e.g. "a5") then it should work.

[added]
I my templete file i do this:

// Page URI
$temp = split('index.php', $_SERVER['REQUEST_URI']);
$link = sefRelToAbs('index.php' . @ $temp[1]);

$head_link = $link . '#to_top';
Last edited by havshoei on Mon Jun 19, 2006 5:27 am, edited 1 time in total.

danimal
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Mon Apr 03, 2006 12:52 am

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by danimal » Mon Jun 19, 2006 7:04 am

havshoei wrote:
danimal wrote: I installed the fix and it still doesn't work. with core joomla sef or open sef.
i believe this had to do with anchors within content items. my problem is all my anchors redirect me to the home page. they will work on the home page though.
Please note that core SEF only handels anchors that comply with HTML 4, that means only strings matching the pattern "[A-Za-z][A-Za-z0-9:_.-]*"

A link as [href="#5"]  pointing to an anchor [] do not match this pattern as it do not start with a letter "A-Za-z" (upper- or lower case letter in the range A to Z), it starts with a digit.

Change your anchors to comply with the above (e.g. "a5") then it should work.

[added]
I my templete file i do this:

// Page URI
$temp = split('index.php', $_SERVER['REQUEST_URI']);
$link = sefRelToAbs('index.php' . @ $temp[1]);

$head_link = $link . '#to_top';
You are referring to the site i had posted above, the site is currently now on their server and the anchor in question follow the rules, it is called "top".

the anchors in the nav have been renamed as well to none numerical names
(the script i used as the starting point i found on the moo/fx forums had them named that way.)

I know how to use anchors, the problem is in joomla. If i turn off sef they work, if I turn them on they dont.

But please people, keep trying to poke holes in my code instead of looking at the real problem. Joomla!
It has been doing this since version 1.0.8. and i even had to toss a nav i made into an iframe to work around the problem in the last joomla site i did about 4 weeks ago.

danimal
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Mon Apr 03, 2006 12:52 am

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by danimal » Mon Jun 19, 2006 7:17 am

Anyways,

I give up. I am ripping the anchor out of this site, and unsubscribing from this thread.

tijs
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 109
Joined: Mon Aug 29, 2005 7:59 pm

Re: [ NOT FIXED!!!] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by tijs » Mon Jun 19, 2006 11:33 am

stingrey wrote: The modified /mambots/content/mossef.php file in SVN attached.
I can confirm that this fix works for me, using 404SEF. Thanks a lot, this was a nasty bug!!!

User avatar
eric
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 107
Joined: Thu Aug 18, 2005 7:55 pm
Location: Maine
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by eric » Mon Jun 19, 2006 1:13 pm

Thanks for posting the fix.. although I'm still having some trouble.  Maybe it has something to do with the fact that I'm using SEF Advance?

When I turn off SEF, the anchors work fine.  When I turn on SEF, the anchors don't show in any of the links.

For example, if my page is located here

http://www.domain.com/thing1/thing2/document/

The HTML for the anchor links is written like this in the editor:

Code: Select all

<a href="#program">The Program</a><br />
<a href="#schedule">Program Schedule</a><br />
However the address that they link to are all the same (without the anchor as part of the link) like this:
http://www.domain.com/thing1/thing2/document/

Any ideas? suggestions?
Think for yourself, question authority.

User avatar
stingrey
Joomla! Hero
Joomla! Hero
Posts: 2756
Joined: Mon Aug 15, 2005 4:36 pm
Location: Marikina, Metro Manila, Philippines
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by stingrey » Mon Jun 19, 2006 3:19 pm

eric wrote: Thanks for posting the fix.. although I'm still having some trouble.  Maybe it has something to do with the fact that I'm using SEF Advance?
What happens if you use Core SEF.

If it works with Core SEF then it is more likely the problem may be in SEF Advance - but I have no way of testing this myself and if you believe it is an issue with SEF Advance you shoudl contact the developer.
Rey Gigataras
http://www.wizmediateam.com <-- great team of talented Web Designers and Programmers!
http://about.me/reygigataras <-- About Me :)
Partner, Business Development & Project Manager, Event Manager, Sports Coach :D

User avatar
eric
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 107
Joined: Thu Aug 18, 2005 7:55 pm
Location: Maine
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by eric » Tue Jun 20, 2006 2:08 pm

stingrey wrote:What happens if you use Core SEF.
I set up a clean test install of Joomla with the sample data, created a new content item with anchors, and applied the fixed mossef.php file.  Anchors worked fine with and without core SEF enabled.. I installed the latest version of SEF Advance and had the same problem as I described earlier.

Thanks for your help, I'll contact Emir.
Think for yourself, question authority.

castus
Joomla! Explorer
Joomla! Explorer
Posts: 338
Joined: Sat Jan 28, 2006 12:00 am
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by castus » Tue Jun 20, 2006 2:14 pm

Thanks for the bug fix it seems to have worked a treat for my content items. However like danimal says if it is in the template, then it doesn't work, as is the case with me.

I have a link in a menu which is for accessibility and skips the content for people using screen readers.

This link isn't working with the fix, and is showing as http://www.castus.co.uk/#content rather than showing the page that you're on with #content at the end.

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by friesengeist » Tue Jun 20, 2006 2:30 pm

castus wrote: This link isn't working with the fix, and is showing as http://www.castus.co.uk/#content rather than showing the page that you're on with #content at the end.
Hi castus,

could you please post the relevant code that prints out the anchor? Without knowing what exactly you do it is hard to find a bug ;)

Best,
Enno
We may not be able to control the wind, but we can always adjust our sails

castus
Joomla! Explorer
Joomla! Explorer
Posts: 338
Joined: Sat Jan 28, 2006 12:00 am
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by castus » Tue Jun 20, 2006 3:36 pm

Umm well, as all of the above posters I had a problem with my anchors when using SEF.

Now since applying the patch that stingrey posted it is now fine again.

But when I set up a menu link (link/url) with #content in it, it doesn't work.

It goes to the site root/#anchor.

I hope this makes more sense and thanks for the help.

castus
Joomla! Explorer
Joomla! Explorer
Posts: 338
Joined: Sat Jan 28, 2006 12:00 am
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by castus » Mon Jun 26, 2006 12:25 pm

Has anyone looked into this further?

User avatar
stingrey
Joomla! Hero
Joomla! Hero
Posts: 2756
Joined: Mon Aug 15, 2005 4:36 pm
Location: Marikina, Metro Manila, Philippines
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by stingrey » Mon Jun 26, 2006 12:44 pm

castus wrote: Has anyone looked into this further?
Please note this issue has not been examined as it differed from teh original report of this thread and this thread is now in the 'Resolved' forum which means it is less visible to the team.

Please start a new thread in the `Joomla! 1.0.x_Q&T` forum to ensure that we can followup on this issue.
Rey Gigataras
http://www.wizmediateam.com <-- great team of talented Web Designers and Programmers!
http://about.me/reygigataras <-- About Me :)
Partner, Business Development & Project Manager, Event Manager, Sports Coach :D

castus
Joomla! Explorer
Joomla! Explorer
Posts: 338
Joined: Sat Jan 28, 2006 12:00 am
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by castus » Mon Jun 26, 2006 12:55 pm

Ok, thanks.

User avatar
72dpi
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Mar 16, 2006 12:47 am

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by 72dpi » Tue Jun 27, 2006 12:54 am

Great Fix Stingrey,

Thanks for your efforts!

Cheers, works PERFECT!

User avatar
josey
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 100
Joined: Thu Jan 12, 2006 9:10 pm
Location: Lake Michigan

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by josey » Mon Jul 10, 2006 4:07 pm

can anyone confirm that this new file works with 1.0.10?


thanks

tijs
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 109
Joined: Mon Aug 29, 2005 7:59 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by tijs » Mon Jul 10, 2006 4:08 pm

Yes it works for me.

User avatar
josey
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 100
Joined: Thu Jan 12, 2006 9:10 pm
Location: Lake Michigan

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by josey » Mon Jul 10, 2006 4:12 pm

cool, you're quick.

when i replaced the file, i just get redirected to the top of the page, however not to the home anymore. i'll try reestablishing my anchors. i am using sef advance, i don't think that sould affect anything though.

any suggestions appreciated

tijs
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 109
Joined: Mon Aug 29, 2005 7:59 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by tijs » Mon Jul 10, 2006 4:27 pm

Make sure you have relative links and anchors. I use 404SEF and it works there. Are you doing a full upgrade to 1.10 or are you just trying to make the anchors work on an old version? You should update to 1.10 anyway...

User avatar
josey
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 100
Joined: Thu Jan 12, 2006 9:10 pm
Location: Lake Michigan

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by josey » Mon Jul 10, 2006 4:49 pm

i see now above that eric had conflicts when using sef advance too. i just pm him. but what do your relative links look like? index.php?option=com_content&task=view&id=1&Itemid=2


thanks

mont
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Jul 11, 2006 6:43 am

Should it work for 1.0.10?

Post by mont » Tue Jul 11, 2006 7:12 am

I have just added the "patched" file to a clean install of 1.0.10 downloaded today, which is showing the same symptoms.

No success. I have unpublished the SEF mambot to solve the problem.
Last edited by mont on Tue Jul 11, 2006 7:15 am, edited 1 time in total.

j00p
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 109
Joined: Thu Mar 02, 2006 3:27 am

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by j00p » Thu Aug 17, 2006 7:01 am

We are also still  having the same problem even after applying the modified patch in /mambots/content/mossef.php.

Using J! 1.0.10, and 404SEF. I also tried with 404SEF turned off and still no luck.

What else could be the problem?

kopoba
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Oct 05, 2006 6:54 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by kopoba » Sun Oct 08, 2006 3:10 am

Thanks stingrey, to me the anchor navigation works fine with modified mossef, 404SEF and accessible Joomla 1.0.11a. Finally!

yourheiness
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Sep 19, 2006 2:31 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by yourheiness » Mon Oct 16, 2006 5:13 pm

Has anyone found a fix for this yet?  I tried installing the fix above (mossef.php) and it did not work either.

Dan2
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Feb 06, 2006 3:46 am

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by Dan2 » Tue Oct 24, 2006 8:15 am

From a quick look at my source code the problem was -- this creates a base for all links meaning anchors won't work. I don't know a fix for your specific problem, but if you download your source, remove this line, and throw in a browser, the anchors will then work fine... so that may be a starting point.

yourheiness
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Sep 19, 2006 2:31 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by yourheiness » Tue Oct 24, 2006 3:39 pm

Dan,

Thanks for the reply.  Forgive me for being ignorant but what to you mean my "throw in a browser".  Do you mean to define the browser (I.E.) in the code?

marlar
Joomla! Hero
Joomla! Hero
Posts: 2747
Joined: Thu Aug 18, 2005 12:21 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by marlar » Mon Oct 30, 2006 9:49 pm

I have the same problem. The fix included in this thread does not help. But Dan2 has put me in the right direction. There surely is a base href in the template, but not inserted by me!

It is inserted on line 193 in frontend.php. If I comment out the line, the anchors work perfectly.

Now I will se if it has any sideeffects.

Does anyone know if the base href is needed at all?
"The Mambot Creator" - MultiThumb, Mosif, Htmlfix, MosHide...
http://kreacom.dk/mambot

marlar
Joomla! Hero
Joomla! Hero
Posts: 2747
Joined: Thu Aug 18, 2005 12:21 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by marlar » Mon Oct 30, 2006 10:01 pm

Yes, it is very much needed!

SEF doesn't work if this line is removed. Get just garbled text.

Now, this is bad: with base href, anchors doesn't work. Without base href, nothing works.

Seems to be a major design flaw in the sef built into Joomla  :(
"The Mambot Creator" - MultiThumb, Mosif, Htmlfix, MosHide...
http://kreacom.dk/mambot

castus
Joomla! Explorer
Joomla! Explorer
Posts: 338
Joined: Sat Jan 28, 2006 12:00 am
Contact:

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by castus » Tue Oct 31, 2006 6:25 am

Does adding the following into your template work?

Code: Select all

<?php
// Page URI
$temp = split('index.php', $_SERVER['REQUEST_URI']);
$link = sefRelToAbs('index.php' . @ $temp[1]);
?>
<a href="<?php  echo $link; ?>#content" class="caccess">Skip to Content</a>

marlar
Joomla! Hero
Joomla! Hero
Posts: 2747
Joined: Thu Aug 18, 2005 12:21 pm

Re: [FIXED] Links to anchor don't work after 1.0.7 to 1.0.9 update

Post by marlar » Tue Oct 31, 2006 7:58 am

No, unfortunately not. The anchor problem is all around, not just on the frontpage.

Besides, I have discovered that it gets even worse with JoomFish because the language specifation is added after the anchor, like

#anchor/lang,en_GB/

I don't want to spend more time on this, so I just disable SEF. Standard SEF isn't that useful anyway.
"The Mambot Creator" - MultiThumb, Mosif, Htmlfix, MosHide...
http://kreacom.dk/mambot


Locked

Return to “Q&T 1.0.x Resolved - Archived”