Gossamer Forum
Home : Products : Gossamer Links : Discussions :

adding anchor tag # into a URl

Quote Reply
adding anchor tag # into a URl
I'm trying to create a link in my pages that will anchor to a specific spot on another page, however, when I try to do this, their is something in the script that converts:

category/subcategory/index.html#anchor
into
category%2fsubcategory%2findex.html% 23anchor.
instead of
category%2fsubcategory%2findex.html#anchor.
the result is
We don't seem to have a category by the name 'category/subcategory/#anchor'.

This happens when paging. If I change the url and go to:

category%2fsubcategory%2findex.html#anchor it works.

so it just seems to be a conversion somewhere (where?) that is doing this.

Is there a way to prevent the # from being converted to % 23 when making a url to somewhere else in the site?

Thanks for your consideration

(please not that there isn't really a space between % 23. This discussion board converts it to the # sign if I don't have the space.)

Peace.

Quote Reply
Re: adding anchor tag # into a URl In reply to
Has anyone a solution for this? It's becoming more important by the day.

peace.

Quote Reply
Re: adding anchor tag # into a URl In reply to
Hi Kyle,

Is this conversion using the dynamic mode? I'll look into the regex to see if it can account for anchors better.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: adding anchor tag # into a URl In reply to
Hi Alex,

Thanks for getting back to me and for looking into this.. Yes, it is the conversion during the dynamic mode. The print version works fine.

Peace.

Quote Reply
Re: [Alex] adding anchor tag # into a dynamic URl In reply to
a four year old thread comes to the top.

I've noticed that LinksSQL still does not parse anchor tags in the dynamic url. I found a fairly simple fix and am wondering if this can be implemented in the next update, as it gets overwritten with each new version.

In Links.pm
sub transform_url

UNDER:
my ($url, $query, $separator) = @_;
return $url unless $IN->param('d');
ADD:
my ($url,$anchor) = split/\#/,$url;



THEN CHANGE:
return $url;
TO:
$anchor? ($url .= "\#" .$IN->escape($anchor) ):();
return $url;

Thank your for the consideration.

peace.
Quote Reply
Re: [klangan] adding anchor tag # into a dynamic URl In reply to
I've just added support for putting anchors in url's in dynamic mode. It'll be available in the next release.

Adrian
Quote Reply
Re: [brewt] adding anchor tag # into a dynamic URl In reply to
Mhh..., it seems that it is still not being fixed yet (V3.2.0).

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
Quote Reply
Re: [ManuGermany] adding anchor tag # into a dynamic URl In reply to
Where are you using anchors? It is working on my copy.

Adrian
Quote Reply
Re: [brewt] adding anchor tag # into a dynamic URl In reply to
it wasn't me Crazy

suddenly it works. perhaps i had a mistake in my code..

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.